PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.0.0
Forumax – AI Powered Advanced Community Forum Plugin v2.0.0
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
bbp-core / includes / admin / Menu.php

Menu.php in Forumax – AI Powered Advanced Community Forum Plugin 2.0.0, at includes/admin/Menu.php

47 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace admin;
3
4 class Menu {
5 function __construct() {
6 add_action( 'admin_menu', [ $this, 'forumax_admin_menu' ] );
7 }
8
9 /**
10 * Create Admin menu
11 *
12 * @return void
13 */
14 public function forumax_admin_menu() {
15 $capability = 'manage_options';
16
17 add_menu_page( __( 'Forumax', 'forumax' ), __( 'Forumax', 'forumax' ), $capability, 'forumax', [ $this, 'forumax_plugin_page' ], FORUMAX_IMG . 'admin/favicon.png', 20 );
18 add_submenu_page( 'forumax', __( 'Forum Builder', 'forumax' ), __( 'Forum Builder', 'forumax' ), $capability, 'forumax' );
19 // add_submenu_page( 'forumax', __( 'Forumax Dashboard', 'forumax' ), __( 'Dashboard', 'forumax' ), $capability, 'admin.php?page=forumax-dashboard', [ $this, 'forumax_statistics_dashboard' ] );
20
21 // Remove menu items.
22 if ( !forumax_get_opt( 'is_bbp_post_types_hidden' ) ) {
23 remove_menu_page( 'edit.php?post_type=forum' );
24 remove_menu_page( 'edit.php?post_type=topic' );
25 remove_menu_page( 'edit.php?post_type=reply' );
26 }
27 }
28
29 /**
30 * Plugin page callback function.
31 *
32 * @return void
33 */
34 public function forumax_plugin_page() {
35 include plugin_dir_path( __FILE__ ) . '/menu/admin_ui.php';
36 }
37
38 /**
39 * Dashboard Statistics.
40 *
41 * @return void
42 */
43 public function forumax_statistics_dashboard() {
44 include plugin_dir_path( __FILE__ ) . '/menu/statistics.php';
45 }
46 }
47