BP_Admin_Setting_Xprofile::register_fields()
Description
Source
File: bp-core/admin/settings/bp-admin-setting-xprofile.php
public function register_fields() {
$this->add_section( 'bp_xprofile', __( 'Profile Settings', 'buddyboss' ) );
// Display name format.
$this->add_field(
'bp-display-name-format',
__( 'Display Name Format', 'buddyboss' ),
[ $this, 'callback_display_name_format']
);
// Avatars.
$this->add_field( 'bp-disable-avatar-uploads', __( 'Profile Avatars', 'buddyboss' ), 'bp_admin_setting_callback_avatar_uploads', 'intval' );
// cover photos.
if ( bp_is_active( 'xprofile', 'cover_image' ) ) {
$this->add_field( 'bp-disable-cover-image-uploads', __( 'Profile Cover Images', 'buddyboss' ), 'bp_admin_setting_callback_cover_image_uploads', 'intval' );
}
// Profile Settings Tutorial
$this->add_field( 'bp-profile-setting-tutorial','', 'bp_profile_setting_tutorial' );
// @todo will use this later on
// Section for profile dashboard.
//$this->add_section( 'bp_profile_dashboard_settings', __( 'Profile Dashboard', 'buddyboss' ) );
// @todo will use this later on
// Enable/Disable profile dashboard.
//$this->add_field( 'bp-enable-member-dashboard', __( 'Profile Dashboard', 'buddyboss' ), [$this, 'bp_admin_setting_callback_member_dashboard'], 'intval' );
// @todo will use this later on
//$this->add_field( 'bp-enable-member-dashboard-redirect', __( 'Redirect on Login', 'buddyboss' ), [$this, 'bp_admin_setting_callback_member_dashboard_redirect'], 'intval' );
// Section for profile types.
$this->add_section( 'bp_member_type_settings', __( 'Profile Types', 'buddyboss' ) );
// Enable/Disable profile types.
$this->add_field( 'bp-member-type-enable-disable', __( 'Profile Types', 'buddyboss' ), [$this, 'bp_admin_setting_callback_member_type_enable_disable'], 'intval' );
// Profile Type enabled then display profile types.
if ( true === bp_member_type_enable_disable() ) {
// Enable/Disable Display on profiles.
$this->add_field( 'bp-member-type-display-on-profile',__( 'Display Profile Types', 'buddyboss' ),[ $this, 'bp_admin_setting_callback_member_type_display_on_profile' ],'intval' );
}
// Default profile type on registration.
if ( true === bp_member_type_enable_disable() ) {
$this->add_field( 'bp-member-type-default-on-registration',__( 'Default Profile Type', 'buddyboss' ),[ $this, 'bp_admin_setting_callback_member_type_default_on_registration' ] );
}
// Profile Types Tutorial
$this->add_field( 'bp-profile-types-tutorial','', [$this, 'bp_profile_types_tutorial'] );
// Section for profile search.
$this->add_section( 'bp_profile_search_settings', __( 'Profile Search', 'buddyboss' ) );
// Enable/Disable profile search.
$this->add_field( 'bp-enable-profile-search', __( 'Profile Search', 'buddyboss' ), [$this, 'bp_admin_setting_callback_profile_search'], 'intval' );
// Profile Search Tutorial
$this->add_field( 'bp-profile-search-tutorial','', [$this, 'bp_profile_search_tutorial'] );
}
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.