isUserPremium = alertboxblock_is_premium(); } public function adminMenu() { if ($this->isUserPremium) { add_menu_page( __('Alert Box Block', 'alert-box-block'), // Page title __('Alert Box Block', 'alert-box-block'), // Menu title 'manage_options', // Capability 'alert-box-block', // Menu slug [$this, 'renderDashboardPage'], // Callback function 'dashicons-images-alt2', // Icon (Dashicons or URL) 20 // Position ); }else { add_submenu_page( 'tools.php', __('Alert Box Block', 'alert-box-block'), __('Alert Box Block', 'alert-box-block'), 'manage_options', 'alert-box-block', [$this, 'renderDashboardPage'], 0 ); } } // public function adminMenu() { // add_submenu_page( // 'tools.php', // __('Alert Box Block', 'alert-box-block'), // __('Alert Box Block', 'alert-box-block'), // 'manage_options', // 'alert-box-block', // [$this, 'renderDashboardPage'], // 0 // ); // } public function renderDashboardPage(){ ?>
ABB_VERSION, 'isPremium' => alertboxblock_is_premium(), 'hasPro' => ABB_HAS_PRO, 'licenseActiveNonce' => wp_create_nonce('bplLicenseActive'), 'nonce' => wp_create_nonce( 'psbCreatePage' ), ] ) ); ?>' >