本文整理汇总了PHP中bp_get_the_profile_field_errors_action函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_the_profile_field_errors_action函数的具体用法?PHP bp_get_the_profile_field_errors_action怎么用?PHP bp_get_the_profile_field_errors_action使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_the_profile_field_errors_action函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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.
*
* @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
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:45,代码来源:class-bp-xprofile-field-type-url.php
示例2: 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';
}
$field = new BP_XProfile_Field(bp_get_the_profile_field_id());
$options = $field->get_children(true);
if (count($options) > 0) {
$step = 1 / pow(10, (int) $options[0]->name);
} else {
$step = 0.01;
}
$html = $this->get_edit_field_html_elements(array_merge(array('type' => 'number', 'step' => $step, 'value' => bp_get_the_profile_field_edit_value()), $raw_properties));
$label = sprintf('<label for="%s">%s%s</label>', bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required() ? ' ' . esc_html__('(required)', 'buddypress') : '');
// Label.
echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
// Errors.
do_action(bp_get_the_profile_field_errors_action());
// Input.
?>
<input <?php
echo $html;
?>
/>
<?php
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:30,代码来源:Bxcft_Field_Type_DecimalNumber.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/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);
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:71,代码来源:class-bp-xprofile-field-type-textarea.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.
*
* @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
}
开发者ID:dcavins,项目名称:buddypress-svn,代码行数:46,代码来源:class-bp-xprofile-field-type-checkbox.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/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
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:67,代码来源:class-bp-xprofile-field-type-radiobutton.php
示例7: 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
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:66,代码来源:class-bp-xprofile-field-type-multiselectbox.php
示例8: 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
}
开发者ID:ncross42,项目名称:dobalance,代码行数:46,代码来源:Bdd_Field_Type_Hierarchy.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/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
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:54,代码来源:class-bp-xprofile-field-type-selectbox.php
示例10: 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
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:51,代码来源:class-bp-xprofile-field-type-textarea.php
示例11: 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
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:41,代码来源:Bxcft_Field_Type_Color.php
示例12: 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' => 'url', 'value' => bp_get_the_profile_field_edit_value()), $raw_properties));
$label = sprintf('<label for="%s">%s%s</label>', bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required() ? ' ' . esc_html__('(required)', 'buddypress') : '');
// Label.
echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
// Errors.
do_action(bp_get_the_profile_field_errors_action());
// Input.
?>
<input <?php
echo $html;
?>
/>
<?php
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:23,代码来源:Bxcft_Field_Type_Web.php
示例13: 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';
}
$field = new BP_XProfile_Field(bp_get_the_profile_field_id());
$args = array('type' => 'number', 'value' => bp_get_the_profile_field_edit_value());
$options = $field->get_children(true);
if ($options) {
foreach ($options as $o) {
if (strpos($o->name, 'min_') !== false) {
$args['min'] = str_replace('min_', '', $o->name);
}
if (strpos($o->name, 'max_') !== false) {
$args['max'] = str_replace('max_', '', $o->name);
}
}
}
$html = $this->get_edit_field_html_elements(array_merge($args, $raw_properties));
$label = sprintf('<label for="%s">%s%s</label>', bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required() ? ' ' . esc_html__('(required)', 'buddypress') : '');
// Label.
echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
// Errors.
do_action(bp_get_the_profile_field_errors_action());
// Input.
?>
<input <?php
echo $html;
?>
/>
<?php
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:36,代码来源:Bxcft_Field_Type_NumberMinMax.php
示例14: edit_field_html
public function edit_field_html(array $raw_properties = array())
{
$user_id = bp_displayed_user_id();
// 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']);
}
// HTML5 required attribute.
if (bp_get_the_profile_field_is_required()) {
$raw_properties['required'] = 'required';
}
$day_html = $this->get_edit_field_html_elements(array_merge(array('id' => bp_get_the_profile_field_input_name() . '_day', 'name' => bp_get_the_profile_field_input_name() . '_day'), $raw_properties));
$month_html = $this->get_edit_field_html_elements(array_merge(array('id' => bp_get_the_profile_field_input_name() . '_month', 'name' => bp_get_the_profile_field_input_name() . '_month'), $raw_properties));
$year_html = $this->get_edit_field_html_elements(array_merge(array('id' => bp_get_the_profile_field_input_name() . '_year', 'name' => bp_get_the_profile_field_input_name() . '_year'), $raw_properties));
$label = sprintf('<label for="%s_day">%s%s</label>', bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required() ? ' ' . esc_html__('(required)', 'buddypress') : '');
// Label.
echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
// Errors
do_action(bp_get_the_profile_field_errors_action());
// Input.
?>
<select <?php
echo $day_html;
?>
>
<?php
bp_the_profile_field_options(array('type' => 'day', 'user_id' => $user_id));
?>
</select>
<select <?php
echo $month_html;
?>
>
<?php
bp_the_profile_field_options(array('type' => 'month', 'user_id' => $user_id));
?>
</select>
<select <?php
echo $year_html;
?>
>
<?php
bp_the_profile_field_options(array('type' => 'year', 'user_id' => $user_id));
?>
</select>
<?php
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:50,代码来源:Bxcft_Field_Type_Birthdate.php
示例15: 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';
}
$html = $this->get_edit_field_html_elements($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());
?>
<select <?php
echo $html;
?>
>
<option value=""><?php
_e('Select...', 'bxcft');
?>
</option>
<?php
bp_the_profile_field_options("user_id={$user_id}");
?>
</select>
<?php
}
开发者ID:baden03,项目名称:buddypress-xprofile-custom-fields-type,代码行数:42,代码来源:Bxcft_Field_Type_SelectCustomTaxonomy.php
示例16: 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.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();
}
$day_r = bp_parse_args($raw_properties, array('id' => bp_get_the_profile_field_input_name() . '_day', 'name' => bp_get_the_profile_field_input_name() . '_day'));
$month_r = bp_parse_args($raw_properties, array('id' => bp_get_the_profile_field_input_name() . '_month', 'name' => bp_get_the_profile_field_input_name() . '_month'));
$year_r = bp_parse_args($raw_properties, array('id' => bp_get_the_profile_field_input_name() . '_year', 'name' => bp_get_the_profile_field_input_name() . '_year'));
?>
<div class="datebox">
<label for="<?php
bp_the_profile_field_input_name();
?>
_day">
<?php
bp_the_profile_field_name();
?>
<?php
bp_the_profile_field_required_label();
?>
</label>
<?php
/**
* Fires after field label and displays associated errors for the field.
*
* This is a dynamic hook that is dependent on the associated
* field ID. The hooks will be similar to `bp_field_12_errors`
* where the 12 is the field ID. Simply replace the 12 with
* your needed target ID.
*
* @since 1.8.0
*/
do_action(bp_get_the_profile_field_errors_action());
?>
<select <?php
echo $this->get_edit_field_html_elements($day_r);
?>
>
<?php
bp_the_profile_field_options(array('type' => 'day', 'user_id' => $user_id));
?>
</select>
<select <?php
echo $this->get_edit_field_html_elements($month_r);
?>
>
<?php
bp_the_profile_field_options(array('type' => 'month', 'user_id' => $user_id));
?>
</select>
<select <?php
echo $this->get_edit_field_html_elements($year_r);
?>
>
<?php
bp_the_profile_field_options(array('type' => 'year', 'user_id' => $user_id));
?>
</select>
</div>
<?php
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:84,代码来源:class-bp-xprofile-field-type-datebox.php
示例17: 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
//.........这里部分代码省略.........
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:101,代码来源:class-ms-addon-profilefields.php
示例18: 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
}
开发者ID:jason-herndon,项目名称:bas-intranet,代码行数:44,代码来源:buddypress-customs.php
示例19: edit_field_html
public function edit_field_html(array $raw_properties = array())
{
if (isset($raw_properties['user_id'])) {
unset($raw_properties['user_id']);
}
$html = $this->get_edit_field_html_elements(array_merge(array('type' => 'file', 'accept' => 'image/*'), $raw_properties));
$uploads = wp_upload_dir();
// Label.
$label = sprintf('<label for="%s">%s%s</label>', bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required() ? esc_html('(required)', 'buddypress') : '');
// Input file.
$input = sprintf('<input type="hidden" name="%1$s" id="%1$s" value="%2$s" /><input %3$s />', bp_get_the_profile_field_input_name(), bp_get_the_profile_field_edit_value() != '' && bp_get_the_profile_field_edit_value() != '-' ? bp_get_the_profile_field_edit_value() : '-', $html);
// Actual image.
if (bp_get_the_profile_field_edit_value() != '' && bp_get_the_profile_field_edit_value() != '-') {
$actual_image = sprintf('<img src="%1$s" alt="%2$s" /><label for="%2$s_deleteimg"><input type="checkbox" name="%2$s_deleteimg" id="%2$s_deleteimg" value="1" /> %3$s</label><input type="hidden" name="%2$s_hiddenimg" id="%2$s_hiddenimg" value="%4$s" />', $uploads['baseurl'] . bp_get_the_profile_field_edit_value(), bp_get_the_profile_field_input_name(), __('Check this to delete this image', 'bxcft'), bp_get_the_profile_field_edit_value());
} elseif (bp_get_profile_field_data(array('field' => bp_get_the_profile_field_id())) != '' && bp_get_profile_field_data(array('field' => bp_get_the_profile_field_id())) != '-') {
$actual_image = sprintf('%1$s<label for="%2$s_deleteimg"><input type="checkbox" name="%2$s_deleteimg" id="%2$s_deleteimg" value="1" /> %3$s</label><input type="hidden" name="%2$s_hiddenimg" id="%2$s_hiddenimg" value="%4$s" />', strip_tags(bp_get_profile_field_data(array('field' => bp_get_the_profile_field_id()))), bp_get_the_profile_field_input_name(), __('Check this to delete this image', 'bxcft'), isset($_POST['field_' . bp_get_the_profile_field_id() . '_hiddenimg']) ? $_POST['field_' . bp_get_the_profile_field_id() . '_hiddenimg'] : '');
} else {
$actual_image = '';
}
echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
do_action(bp_get_the_profile_field_errors_action());
echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
echo apply_filters('bxcft_field_actual_image', $actual_image, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_edit_value());
?>
<script type="text/javascript">
if (jQuery('#profile-edit-fo
|
请发表评论