BP_XProfile_Component::setup_settings_nav()

Set up the Settings > Profile nav item.

Description

Loaded in a separate method because the Settings component may not be loaded in time for BP_XProfile_Component::setup_nav().

Source

File: bp-xprofile/classes/class-bp-xprofile-component.php

	public function setup_settings_nav() {
		if ( ! bp_is_active( 'settings' ) ) {
			return;
		}

		// Determine user to use.
		if ( bp_displayed_user_domain() ) {
			$user_domain = bp_displayed_user_domain();
		} elseif ( bp_loggedin_user_domain() ) {
			$user_domain = bp_loggedin_user_domain();
		} else {
			return;
		}

		// Get the settings slug.
		$settings_slug = bp_get_settings_slug();

		bp_core_new_subnav_item( array(
			'name'            => __( 'Privacy', 'buddyboss' ),
			'slug'            => 'profile',
			'parent_url'      => trailingslashit( $user_domain . $settings_slug ),
			'parent_slug'     => $settings_slug,
			'screen_function' => 'bp_xprofile_screen_settings',
			'position'        => 30,
			'user_has_access' => bp_core_can_edit_settings()
		), 'members' );
	}

Changelog

Changelog
Version Description
BuddyPress 2.1.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.