BBP_Admin::admin_menus()

Add the admin menus

Description

Source

File: bp-forums/admin/admin.php

	public function admin_menus() {

		$hooks = array();

		// These are later removed in admin_head
		if ( current_user_can( 'bbp_tools_page' ) ) {
			if ( current_user_can( 'bbp_tools_repair_page' ) ) {
				$hooks[] = add_submenu_page(
					'buddyboss-platform',
					__( 'Repair Forums', 'buddyboss' ),
					__( 'Forum Repair', 'buddyboss' ),
					$this->minimum_capability,
					'bbp-repair',
					'bbp_admin_repair'
				);
			}

			if ( current_user_can( 'bbp_tools_import_page' ) ) {
				$hooks[] = add_submenu_page(
					'buddyboss-platform',
					__( 'Import Forums', 'buddyboss' ),
					__( 'Forum Import', 'buddyboss' ),
					$this->minimum_capability,
					'bbp-converter',
					'bbp_converter_settings'
				);
			}

			if ( current_user_can( 'bbp_tools_reset_page' ) ) {
//				$hooks[] = add_submenu_page(
//					'buddyboss-platform',
//					__( 'Reset Forums', 'buddyboss' ),
//					__( 'Forum Reset', 'buddyboss' ),
//					$this->minimum_capability,
//					'bbp-reset',
//					'bbp_admin_reset'
//				);
			}

			// Fudge the highlighted subnav item when on a Forums admin page
			foreach ( $hooks as $hook ) {
				add_action( "admin_head-$hook", 'bbp_tools_modify_menu_highlight' );
			}

		}

		// Bail if plugin is not network activated
		if ( ! is_plugin_active_for_network( bbpress()->basename ) )
			return;

		add_submenu_page(
			'index.php',
			__( 'Update Forums', 'buddyboss' ),
			__( 'Update Forums', 'buddyboss' ),
			'manage_network',
			'bbp-update',
			array( $this, 'update_screen' )
		);
	}

Changelog

Changelog
Version Description
bbPress (r2646) 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.