Contents

BP_Admin::adjust_buddyboss_menus()

Description

Source

File: bp-core/classes/class-bp-admin.php

	public function adjust_buddyboss_menus() {
		global $menu, $submenu;

		// only if login user has access to menu
		if ( ! isset( $submenu[ 'buddyboss-platform' ] ) ) {
			return;
		}

		$submenu[ 'buddyboss-platform' ] = array_values( $submenu[ 'buddyboss-platform' ] );

		if ( isset( $app_menu ) ) {
			$submenu[ 'buddyboss-platform' ][] = $app_menu;
		}

		// if there's no buddyboss plugin, don't do anything
		if (! array_key_exists('buddyboss-settings', $submenu)) {
			return;
		}

		add_submenu_page( $this->settings_page, '', '', $this->capability, 'bp-plugin-seperator' );

		$submenu['buddyboss-platform'] = array_merge(
			$submenu['buddyboss-platform'],
			$submenu['buddyboss-settings']
		);

		remove_menu_page( 'buddyboss-settings' );
		unset( $submenu['buddyboss-settings'] );
	}

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.