This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
BP_XProfile_Field::is_default_field( int $field_id )
Return if a field ID is the default field.
Description
Parameters
- $field_id
-
(Required) ID of field to check.
Return
(bool)
Source
File: bp-xprofile/classes/class-bp-xprofile-field.php
private function is_default_field( $field_id = 0 ) { // Fallback to current field ID if none passed. if ( empty( $field_id ) ) { $field_id = $this->id; } $synced_fields = [ bp_xprofile_firstname_field_id(), bp_xprofile_nickname_field_id(), bp_xprofile_lastname_field_id() ]; if ( bp_get_option( 'bp-display-name-format' ) == 'first_last_name' ) { $synced_fields[] = bp_xprofile_lastname_field_id(); } // Compare & return. return in_array( $field_id, array_filter( $synced_fields ) ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.3.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.