BP_Admin::site_admin_menus()

Register site-admin nav menu elements.

Description

Source

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

	public function site_admin_menus() {
		if ( ! bp_current_user_can( 'manage_options' ) ) {
			return;
		}

		$hooks = array();

		// Appearance > Emails.
		$hooks[] = add_theme_page(
			__( 'Emails', 'buddyboss' ),
			__( 'Emails', 'buddyboss' ),
			$this->capability,
			'bp-emails-customizer-redirect',
			'bp_email_redirect_to_customizer'
		);

		if ( is_network_admin() && bp_is_network_activated() ) {
			$email_url = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() );
		} else {
			$email_url = 'edit.php?post_type=' . bp_get_email_post_type();
		}

		$hooks[] = add_submenu_page(
			'buddyboss-platform',
			__( 'Emails', 'buddyboss' ),
			__( 'Emails', 'buddyboss' ),
			'bp_moderate',
			$email_url,
			''
		);

		foreach( $hooks as $hook ) {
			add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
		}
	}

Changelog

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