BP_XProfile_Component::setup_settings_nav()

Set up the Settings > Profile nav item.


Description Description

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


Source 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'            => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ),
			'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' );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.