BP_XProfile_Field_Type_Telephone::admin_new_field_html( BP_XProfile_Field $current_field, string $control_type = '' )
This method usually outputs HTML for this field type’s children options on the wp-admin Profile Fields “Add Field” and “Edit Field” screens, but for this field type, we don’t want it, so it’s stubbed out.
Description
Parameters
- $current_field
-
(Required) The current profile field on the add/edit screen.
- $control_type
-
(Optional) HTML input type used to render the current field's child options.
Default value: ''
Source
File: bp-xprofile/classes/class-bp-xprofile-field-type-telephone.php
public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) { $type = array_search( get_class( $this ), bp_xprofile_get_field_types() ); if ( false === $type ) { return; } $class = $current_field->type != $type ? 'display: none;' : ''; $settings = $this->get_field_settings( $current_field ); ?> <div id="<?php echo esc_attr( $type ); ?>" class="postbox bp-options-box <?php echo $current_field->type;?>" style="<?php echo esc_attr( $class ); ?> margin-top: 15px;"> <table class="form-table bp-date-options"> <tr> <th scope="row"> <label for="phone-format-elapsed"><?php _e( 'Phone Format', 'buddyboss' );?></label> </th> <td> <select name="field-settings[phone_format]" id="phone-format" > <?php foreach ( $this->get_phone_formats() as $format => $details ) { printf( "<option value='%s' %s >%s</option>", $format, selected( $settings['phone_format'], $format, false ), $details['label'] ); } ?> </select> </td> </tr> </table> </div> <?php }
Changelog
Version | Description |
---|---|
BuddyPress 3.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.