# bbp-core/2.2.0/includes/admin/Menu.php

Forumax – AI Powered Advanced Community Forum Plugin, version 2.2.0. 105 lines.

- Page: https://pluginprobe.com/plugins/bbp-core/2.2.0/code/includes/admin/Menu.php
- Raw: https://pluginprobe.com/plugins/bbp-core/2.2.0/raw/includes/admin/Menu.php
- Modified: 2026-02-21T10:57:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bbp-core/2.2.0/code/includes/admin/Menu.php#L10-L20`.

```php
<?php
namespace admin;

/**
 * Menu class for Forumax admin pages.
 *
 * Handles the registration and rendering of all admin menu pages.
 *
 * @package Forumax
 * @since   1.0.0
 */
class Menu {

	/**
	 * Constructor.
	 *
	 * Initializes the menu hooks.
	 */
	public function __construct() {
		add_action( 'admin_menu', [ $this, 'forumax_admin_menu' ] );
	}

	/**
	 * Create Admin menu and submenu pages.
	 *
	 * Registers the main Forumax menu and all submenu pages.
	 * The main menu opens the Dashboard page.
	 *
	 * @return void
	 */
	public function forumax_admin_menu() {
		$capability = 'manage_options';

		// Main menu page - opens Dashboard.
		add_menu_page(
			__( 'Forumax', 'forumax' ),
			__( 'Forumax', 'forumax' ),
			$capability,
			'forumax',
			[ $this, 'forumax_dashboard_page' ],
			FORUMAX_IMG . 'admin/favicon.png',
			20
		);

		// Dashboard submenu (matches parent slug so it doesn't duplicate).
		add_submenu_page(
			'forumax',
			__( 'Dashboard', 'forumax' ),
			__( 'Dashboard', 'forumax' ),
			$capability,
			'forumax',
			[ $this, 'forumax_dashboard_page' ]
		);

		// Forum Builder submenu.
		add_submenu_page(
			'forumax',
			__( 'Forum Builder', 'forumax' ),
			__( 'Forum Builder', 'forumax' ),
			$capability,
			'forumax-builder',
			[ $this, 'forumax_plugin_page' ]
		);

		// Remove default bbPress menu items if setting is disabled.
		if ( ! forumax_get_opt( 'is_bbp_post_types_hidden' ) ) {
			remove_menu_page( 'edit.php?post_type=forum' );
			remove_menu_page( 'edit.php?post_type=topic' );
			remove_menu_page( 'edit.php?post_type=reply' );
		}
	}

	/**
	 * Forum Builder page callback function.
	 *
	 * Renders the main forum builder admin UI.
	 *
	 * @return void
	 */
	public function forumax_plugin_page() {
		include plugin_dir_path( __FILE__ ) . '/menu/admin_ui.php';
	}

	/**
	 * Dashboard page callback function.
	 *
	 * Renders the comprehensive dashboard with statistics and activity.
	 *
	 * @return void
	 */
	public function forumax_dashboard_page() {
		include plugin_dir_path( __FILE__ ) . '/menu/dashboard.php';
	}

	/**
	 * Legacy Dashboard Statistics.
	 *
	 * @deprecated 2.1.0 Use forumax_dashboard_page() instead.
	 * @return void
	 */
	public function forumax_statistics_dashboard() {
		include plugin_dir_path( __FILE__ ) . '/menu/statistics.php';
	}
}

```
