本文整理汇总了PHP中bp_the_profile_field_name函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_the_profile_field_name函数的具体用法?PHP bp_the_profile_field_name怎么用?PHP bp_the_profile_field_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_the_profile_field_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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/input.number.html permitted attributes}
* that you want to add.
*
* @since 2.1.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('type' => 'text', 'inputmode' => 'url', 'value' => esc_url(bp_get_the_profile_field_edit_value())));
?>
<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());
?>
<input <?php
echo $this->get_edit_field_html_elements($r);
?>
>
<?php
}
示例3: edit_field_html
public function edit_field_html(array $raw_properties = array())
{
$user_id = bp_displayed_user_id();
if (isset($raw_properties['user_id'])) {
$user_id = (int) $raw_properties['user_id'];
unset($raw_properties['user_id']);
}
// HTML5 required attribute.
if (bp_get_the_profile_field_is_required()) {
$raw_properties['required'] = 'required';
$required = true;
} else {
$required = false;
}
?>
<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());
?>
<?php
bp_the_profile_field_options("user_id={$user_id}&required={$required}");
?>
<?php
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:35,代码来源:Bxcft_Field_Type_CheckboxAcceptance.php
示例4: 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/input.checkbox.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 we pass to
// {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
$user_id = (int) $raw_properties['user_id'];
unset($raw_properties['user_id']);
} else {
$user_id = bp_displayed_user_id();
}
?>
<fieldset class="checkbox">
<legend>
<?php
bp_the_profile_field_name();
?>
<?php
bp_the_profile_field_required_label();
?>
</legend>
<?php
/** This action is documented in bp-xprofile/bp-xprofile-classes */
do_action(bp_get_the_profile_field_errors_action());
?>
<?php
bp_the_profile_field_options(array('user_id' => $user_id));
?>
</fieldset>
<?php
}
示例5: 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/input.radio.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 we pass to
// {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
$user_id = (int) $raw_properties['user_id'];
unset($raw_properties['user_id']);
} else {
$user_id = bp_displayed_user_id();
}
?>
<div class="radio">
<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());
?>
<?php
bp_the_profile_field_options(array('user_id' => $user_id));
if (!bp_get_the_profile_field_is_required()) {
?>
<a class="clear-value" href="javascript:clear( '<?php
echo esc_js(bp_get_the_profile_field_input_name());
?>
' );">
<?php
esc_html_e('Clear', 'buddypress');
?>
</a>
<?php
}
?>
</div>
<?php
}
示例6: 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/select.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 we pass to
// {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
$user_id = (int) $raw_properties['user_id'];
unset($raw_properties['user_id']);
} else {
$user_id = bp_displayed_user_id();
}
$r = bp_parse_args($raw_properties, array('multiple' => 'multiple', 'id' => bp_get_the_profile_field_input_name() . '[]', 'name' => bp_get_the_profile_field_input_name() . '[]'));
?>
<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
/** This action is documented in bp-xprofile/bp-xprofile-classes */
do_action(bp_get_the_profile_field_errors_action());
?>
<select <?php
echo $this->get_edit_field_html_elements($r);
?>
>
<?php
bp_the_profile_field_options(array('user_id' => $user_id));
?>
</select>
<?php
if (!bp_get_the_profile_field_is_required()) {
?>
<a class="clear-value" href="javascript:clear( '<?php
echo esc_js(bp_get_the_profile_field_input_name());
?>
[]' );">
<?php
esc_html_e('Clear', 'buddypress');
?>
</a>
<?php
}
?>
<?php
}
示例7: edit_field_html
public function edit_field_html(array $raw_properties = array())
{
if (isset($raw_properties['user_id'])) {
unset($raw_properties['user_id']);
}
// HTML5 required attribute.
if (bp_get_the_profile_field_is_required()) {
$raw_properties['required'] = 'required';
}
$input_name = bp_get_the_profile_field_input_name();
$html = $this->get_edit_field_html_elements(array_merge(array('type' => 'text', 'value' => bp_get_the_profile_field_edit_value()), $raw_properties));
?>
<label for="<?php
echo $input_name;
?>
"><?php
echo bp_the_profile_field_name() . (bp_get_the_profile_field_is_required() ? esc_html_e('(required)', 'buddypress') : '');
?>
</label>
<?php
do_action(bp_get_the_profile_field_errors_action());
?>
<input id="textHierarchy" <?php
echo $html;
?>
readonly>
<input type="button" id="openHierarchy" value="지역(선거구) 선택" class="btn" style="height: 40px;">
<div id="layerHierarchy">
<div class="selectHierarchy popup-list valign-outer" style="display:block">
<div class="valign-middle contents">
<div class="center-block">
<ul class="nav nav-tabs">
<li class="tab1"><a href="#">선거구 선택</a></li>
</ul>
<div id="divHierarchy" >
</div>
<span id="submitHierarchy" class="btn btn-default">SUBMIT</span>
<span id="closeHierarchy" class="btn btn-default">CLOSE</span>
</div>
</div>
</div>
</div>
<?php
}
示例8: 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/select.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 we pass to
// {@link bp_the_profile_field_options()}.
if (isset($raw_properties['user_id'])) {
$user_id = (int) $raw_properties['user_id'];
unset($raw_properties['user_id']);
} else {
$user_id = bp_displayed_user_id();
}
?>
<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());
?>
<select <?php
echo $this->get_edit_field_html_elements($raw_properties);
?>
>
<?php
bp_the_profile_field_options(array('user_id' => $user_id));
?>
</select>
<?php
}
示例9: 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
}
示例10: edit_field_html
public function edit_field_html(array $raw_properties = array())
{
if (isset($raw_properties['user_id'])) {
unset($raw_properties['user_id']);
}
// HTML5 required attribute.
if (bp_get_the_profile_field_is_required()) {
$raw_properties['required'] = 'required';
}
$html = $this->get_edit_field_html_elements(array_merge(array('type' => 'color', 'value' => bp_get_the_profile_field_edit_value()), $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());
?>
<input <?php
echo $html;
?>
>
<script>
if (!Modernizr.inputtypes.color) {
// No html5 field colorpicker => Calling jscolor.
jQuery('input#<?php
bp_the_profile_field_input_name();
?>
').addClass('color');
}
</script>
<?php
}
示例11: display_global_profile_fields
/**
* Display the global fields on the users public profile.
*
* @since 1.0
*
*/
public function display_global_profile_fields()
{
global $profile_template;
$this->write_log($profile_template);
if ($profile_template->field->visibility_level == 'global') {
$this->write_log($profile_template->field->visibility_level);
$global_field_value = bp_xprofile_get_meta($profile_template->field->id, 'field', 'global_value');
if (!empty($global_field_value) || '0' === $global_field_value) {
$value = maybe_unserialize($global_field_value);
} else {
$value = false;
}
if (!empty($value) || '0' === $value) {
?>
<tr<?php
bp_field_css_class();
?>
>
<td class="label"><?php
bp_the_profile_field_name();
?>
</td>
<td class="data"><?php
echo $value;
?>
</td>
</tr>
<?php
}
}
}
开发者ID:nightbook,项目名称:buddypress-admin-global-profile-fields,代码行数:42,代码来源:bp-admin-only-profile-fields.php
示例12: xprofile_admin_field
/**
* Handles the WYSIWYG display of each profile field on the edit screen.
*
* @since 1.5.0
*
* @param object $admin_field Admin field.
* @param object $admin_group Admin group object.
* @param string $class Classes to append to output.
*/
function xprofile_admin_field($admin_field, $admin_group, $class = '')
{
global $field;
$field = $admin_field;
?>
<fieldset id="draggable_field_<?php
echo esc_attr($field->id);
?>
"class="sortable<?php
echo ' ' . $field->type;
if (!empty($class)) {
echo ' ' . $class;
}
?>
">
<legend>
<span>
<?php
bp_the_profile_field_name();
?>
<?php
if (empty($field->can_delete)) {
esc_html_e('(Primary)', 'buddypress');
}
?>
<?php
bp_the_profile_field_required_label();
?>
<?php
if (bp_xprofile_get_meta($field->id, 'field', 'signup_position')) {
esc_html_e('(Sign-up)', 'buddypress');
}
?>
<?php
if (bp_get_member_types()) {
echo $field->get_member_type_label();
}
?>
<?php
/**
* Fires at end of legend above the name field in base xprofile group.
*
* @since 2.2.0
*
* @param BP_XProfile_Field $field Current BP_XProfile_Field
* object being rendered.
*/
do_action('xprofile_admin_field_name_legend', $field);
?>
</span>
</legend>
<div class="field-wrapper">
<?php
if (in_array($field->type, array_keys(bp_xprofile_get_field_types()))) {
$field_type = bp_xprofile_create_field_type($field->type);
$field_type->admin_field_html();
} else {
/**
* Fires after the input if the current field is not in default field types.
*
* @since 1.5.0
*
* @param BP_XProfile_Field $field Current BP_XProfile_Field
* object being rendered.
* @param int $value Integer 1.
*/
do_action('xprofile_admin_field', $field, 1);
}
?>
<?php
if ($field->description) {
?>
<p class="description"><?php
echo esc_attr($field->description);
?>
</p>
<?php
}
?>
<div class="actions">
<a class="button edit" href="users.php?page=bp-profile-setup&group_id=<?php
echo esc_attr($admin_group->id);
?>
//.........这里部分代码省略.........
示例13: edit_field_html
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('type' => 'text', 'inputmode' => 'url', 'value' => esc_url(bp_get_the_profile_field_edit_value())));
$r['class'] = $r['class'] . ' form-control';
?>
<div class="form-group">
<label class="control-label col-sm-3" 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)', 'firmasite');
?>
<?php
}
?>
</label>
<div class="col-sm-9">
<?php
do_action(bp_get_the_profile_field_errors_action());
?>
<input <?php
echo $this->get_edit_field_html_elements($r);
?>
>
</div>
</div>
<?php
}
示例14: form_settings_xprofile_fields
public static function form_settings_xprofile_fields($gmw_forms, $formID, $section, $option)
{
global $bp;
if (!bp_is_active('xprofile')) {
_e('Buddypress xprofile fields component is deactivated. You will need to activate in in order to use this feature.', 'GMW');
return;
}
if (function_exists('bp_has_profile')) {
if (bp_has_profile('hide_empty_fields=0')) {
$dateboxes = array();
$dateboxes[0] = '';
while (bp_profile_groups()) {
bp_the_profile_group();
while (bp_profile_fields()) {
bp_the_profile_field();
if (bp_get_the_profile_field_type() == 'datebox' || bp_get_the_profile_field_type() == 'birthdate') {
$dateboxes[] = bp_get_the_profile_field_id();
} else {
$field_id = bp_get_the_profile_field_id();
?>
<input type="checkbox" name="<?php
echo 'gmw_forms[' . $formID . '][' . $section . '][profile_fields][]';
?>
" value="<?php
echo $field_id;
?>
" <?php
if (isset($gmw_forms[$formID][$section]['profile_fields']) && in_array($field_id, $gmw_forms[$formID][$section]['profile_fields'])) {
echo ' checked=checked';
}
?>
/>
<label><?php
bp_the_profile_field_name();
?>
</label>
<br />
<?php
}
}
}
?>
<label><strong style="margin:5px 0px;float:left;width:100%"><?php
_e('Choose the "Age Range" Field', 'GMW');
?>
</strong></label><br />
<select name="<?php
echo 'gmw_forms[' . $formID . '][' . $section . '][profile_fields_date]';
?>
">
<?php
foreach ($dateboxes as $datebox) {
$field = new BP_XProfile_Field($datebox);
$selected = $gmw_forms[$formID][$section]['profile_fields_date'] == $datebox ? 'selected="selected"' : '';
?>
<option value="<?php
echo $datebox;
?>
" <?php
echo $selected;
?>
><?php
echo $field->name;
?>
</option>
<?php
}
?>
</select>
<?php
}
}
}
示例15: bp_the_profile_field_input_name
</div>
<?php
}
?>
<?php
if ('datebox' == bp_get_the_profile_field_type()) {
?>
<div class="datebox">
<label for="<?php
bp_the_profile_field_input_name();
?>
_day"><?php
bp_the_profile_field_name();
?>
<?php
if (bp_get_the_profile_field_is_required()) {
_e('(required)', 'buddypress');
}
?>
</label>
<?php
do_action('bp_' . bp_get_the_profile_field_input_name() . '_errors');
?>
<select name="<?php
bp_the_profile_field_input_name();
?>
_day" id="<?php