'; add_menu_page( __('Dashboard', 'acychecker'), 'AcyChecker', 'manage_options', ACYC_COMPONENT.'_dashboard', [$this, 'router'], 'data:image/svg+xml;base64,'.base64_encode( $svg ), 42 ); add_submenu_page( ACYC_COMPONENT.'_dashboard', __('Clean my database', 'acychecker'), __('Clean my database', 'acychecker'), 'manage_options', ACYC_COMPONENT.'_database', [$this, 'router'] ); add_submenu_page( ACYC_COMPONENT.'_dashboard', __('Block on registration', 'acychecker'), __('Block on registration', 'acychecker'), 'manage_options', ACYC_COMPONENT.'_registration', [$this, 'router'] ); add_submenu_page( ACYC_COMPONENT.'_dashboard', __('Tests', 'acychecker'), __('Tests', 'acychecker'), 'manage_options', ACYC_COMPONENT.'_tests', [$this, 'router'] ); add_submenu_page( ACYC_COMPONENT.'_dashboard', __('Single test', 'acychecker'), __('Single test', 'acychecker'), 'manage_options', ACYC_COMPONENT.'_singletest', [$this, 'router'] ); add_submenu_page( ACYC_COMPONENT.'_dashboard', __('Configuration', 'acychecker'), __('Configuration', 'acychecker'), 'manage_options', ACYC_COMPONENT.'_configuration', [$this, 'router'] ); // In WordPress, the first submenu is called "AcyChecker" instead of "Dashboard" so we rename it manually global $submenu; if (isset($submenu[ACYC_COMPONENT.'_dashboard'])) { $submenu[ACYC_COMPONENT.'_dashboard'][0][0] = __('Dashboard', 'acychecker'); } } public function router() { if (!current_user_can('manage_options')) { wp_die(esc_html__('Sorry, you are not allowed to access this page.'), '', ['response' => 403]); } new RouterService(); } }