/** * 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 }
/** * 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); } }
/** * 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 }
/** * 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/select.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(); } $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 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()); ?> <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 }
/** * 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.radio.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(); } ?> <div class="radio"> <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()); ?> <?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 }
/** * 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/select.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(); } ?> <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()); ?> <select <?php echo $this->get_edit_field_html_elements($raw_properties); ?> > <?php bp_the_profile_field_options(array('user_id' => $user_id)); ?> </select> <?php }
/** * 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 }
/** * 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); ?> &field_id=<?php echo esc_attr($field->id); ?> &mode=edit_field"><?php _e('Edit', 'buddypress'); ?> </a> <?php if ($field->can_delete) { ?> <div class="delete-button"> <a class="confirm submit-delete deletion" href="users.php?page=bp-profile-setup&field_id=<?php echo esc_attr($field->id); ?> &mode=delete_field"><?php _e('Delete', 'buddypress'); ?> </a> </div> <?php } ?> <?php /** * Fires at end of field management links in xprofile management admin. * * @since 2.2.0 * * @param BP_XProfile_Group $group BP_XProfile_Group object * for the current group. */ do_action('xprofile_admin_field_action', $field); ?> </div> </div> </fieldset> <?php }
protected function _element_html_radio($raw_properties = array(), $user_id = null) { ?> <div class="radio"> <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()); ?> <?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 }