本文整理汇总了PHP中bp_the_profile_field_edit_value函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_the_profile_field_edit_value函数的具体用法?PHP bp_the_profile_field_edit_value怎么用?PHP bp_the_profile_field_edit_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_the_profile_field_edit_value函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_field_html
/**
* Output the edit field HTML for this field type.
*
* Must be used inside the {@link bp_profile_fields()} template loop.
*
* @since 2.0.0
*
* @param array $raw_properties Optional key/value array of
* {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes}
* that you want to add.
*/
public function edit_field_html(array $raw_properties = array())
{
// User_id is a special optional parameter that certain other fields
// types pass to {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
unset($raw_properties['user_id']);
}
$richtext_enabled = bp_xprofile_is_richtext_enabled_for_field();
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
">
<?php
bp_the_profile_field_name();
?>
<?php
bp_the_profile_field_required_label();
?>
</label>
<?php
/** This action is documented in bp-xprofile/bp-xprofile-classes */
do_action(bp_get_the_profile_field_errors_action());
if (!$richtext_enabled) {
$r = wp_parse_args($raw_properties, array('cols' => 40, 'rows' => 5));
?>
<textarea <?php
echo $this->get_edit_field_html_elements($r);
?>
><?php
bp_the_profile_field_edit_value();
?>
</textarea>
<?php
} else {
/**
* Filters the arguments passed to `wp_editor()` in richtext xprofile fields.
*
* @since 2.4.0
*
* @param array $args {
* Array of optional arguments. See `wp_editor()`.
* @type bool $teeny Whether to use the teeny version of TinyMCE. Default true.
* @type bool $media_buttons Whether to show media buttons. Default false.
* @type bool $quicktags Whether to show the quicktags buttons. Default true.
* @type int $textarea_rows Number of rows to display in the editor. Defaults to 1 in the
* 'admin' context, and 10 in the 'edit' context.
* }
* @param string $context The display context. 'edit' when the markup is intended for the
* profile edit screen, 'admin' when intended for the Profile Fields
* Dashboard panel.
*/
$editor_args = apply_filters('bp_xprofile_field_type_textarea_editor_args', array('teeny' => true, 'media_buttons' => false, 'quicktags' => true, 'textarea_rows' => 10), 'edit');
wp_editor(bp_get_the_profile_field_edit_value(), bp_get_the_profile_field_input_name(), $editor_args);
}
}
示例2: edit_field_html
/**
* Output the edit field HTML for this field type.
*
* Must be used inside the {@link bp_profile_fields()} template loop.
*
* @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} that you want to add.
* @since 2.0.0
*/
public function edit_field_html(array $raw_properties = array())
{
// user_id is a special optional parameter that certain other fields
// types pass to {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
unset($raw_properties['user_id']);
}
$r = bp_parse_args($raw_properties, array('cols' => 40, 'rows' => 5));
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
">
<?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
?>
<?php
esc_html_e('(required)', 'buddypress');
?>
<?php
}
?>
</label>
<?php
/** This action is documented in bp-xprofile/bp-xprofile-classes */
do_action(bp_get_the_profile_field_errors_action());
?>
<textarea <?php
echo $this->get_edit_field_html_elements($r);
?>
><?php
bp_the_profile_field_edit_value();
?>
</textarea>
<?php
}
示例3: edit_field_html
/**
* Output the edit field HTML for this field type.
*
* Must be used inside the {@link bp_profile_fields()} template loop.
*
* @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} that you want to add.
* @since BuddyPress (2.0.0)
*/
public function edit_field_html(array $raw_properties = array())
{
// user_id is a special optional parameter that certain other fields types pass to {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
unset($raw_properties['user_id']);
}
$html = $this->get_edit_field_html_elements(array_merge(array('cols' => 40, 'rows' => 5), $raw_properties));
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
esc_html_e('(required)', 'buddypress');
}
?>
</label>
<?php
do_action(bp_get_the_profile_field_errors_action());
?>
<textarea <?php
echo $html;
?>
><?php
bp_the_profile_field_edit_value();
?>
</textarea>
<?php
}
示例4: _e
if (bp_get_the_profile_field_is_required()) {
_e('(required)', 'buddypress');
}
?>
</label>
<?php
do_action('bp_' . bp_get_the_profile_field_input_name() . '_errors');
?>
<textarea rows="5" cols="40" name="<?php
bp_the_profile_field_input_name();
?>
" id="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_edit_value();
?>
</textarea>
<?php
}
?>
<?php
if ('selectbox' == bp_get_the_profile_field_type()) {
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
示例5: render_bp_field
/**
* Renders Buddypress profile field
*
* @param object $bp_field.
* @param boolean $returm.
* @author peshkov@UD
*/
protected function render_bp_field($bp_field, $return = false)
{
global $field;
$field = $bp_field;
$type = bp_get_the_profile_field_type();
ob_start();
switch ($type) {
case 'textbox':
?>
<div class="bp textbox">
<input type="text" name="bp[<?php
bp_the_profile_field_input_name();
?>
]" id="<?php
bp_the_profile_field_input_name();
?>
" value="<?php
bp_the_profile_field_edit_value();
?>
" <?php
if (bp_get_the_profile_field_is_required()) {
?>
aria-required="true"<?php
}
?>
/>
</div>
<?php
break;
case 'textarea':
?>
<div class="bp textarea">
<textarea rows="5" cols="40" name="bp[<?php
bp_the_profile_field_input_name();
?>
]" id="<?php
bp_the_profile_field_input_name();
?>
" <?php
if (bp_get_the_profile_field_is_required()) {
?>
aria-required="true"<?php
}
?>
><?php
bp_the_profile_field_edit_value();
?>
</textarea>
</div>
<?php
break;
case 'selectbox':
?>
<div class="bp selectbox">
<select name="bp[<?php
bp_the_profile_field_input_name();
?>
]" id="<?php
bp_the_profile_field_input_name();
?>
" <?php
if (bp_get_the_profile_field_is_required()) {
?>
aria-required="true"<?php
}
?>
>
<?php
bp_the_profile_field_options();
?>
</select>
</div>
<?php
break;
case 'multiselectbox':
$input_type = bp_get_the_profile_field_input_name();
preg_match('/field_[0-9]+/', $input_type, $matches);
if ($matches) {
$input_type = $matches[0];
}
?>
<div class="bp multiselectbox">
<select name="bp[<?php
echo $input_type;
?>
][]" id="<?php
echo $input_type;
?>
" multiple="multiple" <?php
if (bp_get_the_profile_field_is_required()) {
?>
aria-required="true"<?php
}
//.........这里部分代码省略.........
示例6: bp_ajax_register_form_function
//.........这里部分代码省略.........
while (bp_profile_fields()) {
bp_the_profile_field();
?>
<div class="ctrlHolder fullwidth">
<?php
if ('textbox' == bp_get_the_profile_field_type()) {
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
_e('', 'buddypress');
}
?>
</label>
<div id="<?php
bp_the_profile_field_input_name();
?>
_error" class="error"></div>
<input type="text" name="<?php
bp_the_profile_field_input_name();
?>
" id="<?php
bp_the_profile_field_input_name();
?>
" value="<?php
bp_the_profile_field_edit_value();
?>
" />
<?php
}
?>
<?php
if ('textarea' == bp_get_the_profile_field_type()) {
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
_e('', 'buddypress');
}
?>
</label>
<div id="<?php
bp_the_profile_field_input_name();
?>
_error" class="error"></div>
<textarea rows="5" cols="40" name="<?php
bp_the_profile_field_input_name();
?>
" id="<?php
bp_the_profile_field_input_name();
示例7: while
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<div<?php bp_field_css_class( 'editfield' ) ?>>
<?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="<?php bp_the_profile_field_edit_value() ?>" />
<?php endif; ?>
<?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_edit_value() ?></textarea>
<?php endif; ?>
<?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
<?php bp_the_profile_field_options() ?>
</select>
<?php endif; ?>
<?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
示例8: _render_buddypress_account_extra_fields
/**
* Renders BuddyPress account extra fields.
*
* @since 3.5
*
* @access private
*/
private function _render_buddypress_account_extra_fields()
{
if (!bp_is_active('xprofile')) {
return;
}
do_action('bp_before_signup_profile_fields');
?>
<div class="register-section" id="profile-details-section">
<h4><?php
_e('Profile Details', 'membership');
?>
</h4>
<?php
if (bp_has_profile('profile_group_id=1&hide_empty_fields=0')) {
?>
<?php
while (bp_profile_groups()) {
bp_the_profile_group();
?>
<?php
while (bp_profile_fields()) {
bp_the_profile_field();
?>
<?php
$field_name = bp_get_the_profile_field_input_name();
?>
<?php
$field_name_esc = esc_attr($field_name);
?>
<?php
$field_type = bp_get_the_profile_field_type();
?>
<div class="editfield">
<?php
if ('textbox' == $field_type) {
?>
<label for="<?php
echo $field_name_esc;
?>
">
<?php
if (bp_get_the_profile_field_is_required()) {
?>
<?php
printf(_x('%s (required)', '{Profile field} (required)', 'membership'), bp_get_the_profile_field_name());
?>
<?php
} else {
?>
<?php
bp_the_profile_field_name();
?>
<?php
}
?>
</label>
<?php
do_action("bp_{$field_name}_errors");
?>
<input type="text" name="<?php
echo $field_name_esc;
?>
" id="<?php
echo $field_name_esc;
?>
" value="<?php
bp_the_profile_field_edit_value();
?>
" />
<?php
}
?>
<?php
if ('textarea' == $field_type) {
?>
<label for="<?php
echo $field_name_esc;
?>
">
<?php
if (bp_get_the_profile_field_is_required()) {
?>
<?php
printf(_x('%s (required)', '{Profile field} (required)', 'membership'), bp_get_the_profile_field_name());
?>
<?php
} else {
?>
<?php
//.........这里部分代码省略.........
示例9: render_xprofile_field
/**
* Generates the HTML code for a single XProfile input field.
*
* Code is taken from the BuddyPress default theme file:
* plugins/buddypress/bp-themes/bp-default/registration/register.php
*
* @since 1.0.1.0
* @param int $field_id The XProfile field ID.
* @param mixed $field_value Value of the field.
* @return string The HTML code to display the field.
*/
public function render_xprofile_field($field_id, $field_value = null, $visibility = false)
{
global $field;
$field = xprofile_get_field($field_id);
ob_start();
?>
<div class="ms-form-element ms-form-element-xprofile editfield field-<?php
echo $field_id;
?>
">
<?php
if ('textarea' == bp_get_the_profile_field_type()) {
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
_e('(required)', 'buddypress');
}
?>
</label>
<?php
do_action(bp_get_the_profile_field_errors_action());
?>
<textarea rows="5" cols="40" name="<?php
bp_the_profile_field_input_name();
?>
" id="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_edit_value();
?>
</textarea>
<?php
} elseif ('selectbox' == bp_get_the_profile_field_type()) {
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
_e('(required)', 'buddypress');
}
?>
</label>
<?php
do_action(bp_get_the_profile_field_errors_action());
?>
<select name="<?php
bp_the_profile_field_input_name();
?>
" id="<?php
bp_the_profile_field_input_name();
?>
">
<?php
bp_the_profile_field_options();
?>
</select>
<?php
} elseif ('multiselectbox' == bp_get_the_profile_field_type()) {
?>
<label for="<?php
bp_the_profile_field_input_name();
?>
"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
_e('(required)', 'buddypress');
}
?>
</label>
<?php
//.........这里部分代码省略.........