wizard_config() ); do_action( 'wizard_enqueue_scripts', 'wizard' ); } /** * Wizard Config * * @return array */ public function wizard_config() { $config = array(); $config['adminUrl'] = admin_url(); $config['dashboard'] = admin_url( 'admin.php?page=jkit' ); $config['ajaxurl'] = admin_url( 'admin-ajax.php' ); $config['installNonce'] = wp_create_nonce( 'updates' ); $config['imageUrl'] = JEG_ELEMENTOR_KIT_URL . '/assets/img/admin'; return $config; } /** * Enqueue Style */ public function enqueue_styles() { wp_enqueue_style( 'jkit-backend-font', 'https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&family=Roboto:wght@400;500;600&display=swap', array(), JEG_ELEMENTOR_KIT_VERSION ); wp_enqueue_style( 'jkit-wizard', JEG_ELEMENTOR_KIT_URL . '/assets/css/admin/wizard.css', array(), JEG_ELEMENTOR_KIT_VERSION ); } /** * Wizard Page. * * @throws \Exception Throw exception. */ public function onboard_wizard_page() { // if ( get_option( 'jkit_wizard_action_complete' ) || ! current_user_can( 'manage_options' ) ) { // wp_die( 'You are not allowed to access this page.', 'Access Denied', array( 'response' => 403 ) ); // } try { if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['nonce'] ), self::$onboard ) ) { // Nanti implement. } if ( ! current_user_can( 'install_plugins' ) ) { throw new \Exception( 'Access denied', 403 ); } header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); $this->set_hook(); $this->render_onboard_wizard(); exit(); } catch ( \Exception $e ) { echo wp_kses( $e->getMessage(), wp_kses_allowed_html() ); } } /** * Render Onboard Wizard. */ public function render_onboard_wizard() { ?> >