activity_log = $activity_log; add_action( 'admin_menu', array( $this, 'admin_menus' ), 10 ); add_action( 'admin_init', array( $this, 'setup_page' ), 10 ); } /** * Add setup admin page. */ public function admin_menus() { add_dashboard_page( '', '', 'manage_options', 'activity-log-mainwp-setup', '' ); } /** * Setup Page Start. */ public function setup_page() { // Get page argument from $_GET array. $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING ); if ( empty( $page ) || 'activity-log-mainwp-setup' !== $page ) { return; } /** * Wizard Steps. */ $wizard_steps = array( 'welcome' => array( 'name' => __( 'Welcome', 'mwp-al-ext' ), 'content' => array( $this, 'step_welcome' ), ), 'wsal_sites' => array( 'name' => __( 'Child Sites', 'mwp-al-ext' ), 'content' => array( $this, 'step_wsal_sites' ), 'save' => array( $this, 'step_wsal_sites_save' ), ), ); /** * Filter: `Wizard Default Steps` * * Extension filter hook to filter wizard steps before they are displayed. * * @param array $wizard_steps – Wizard Steps. */ $this->wizard_steps = apply_filters( 'mwpal_wizard_default_steps', $wizard_steps ); // Set current step. $current_step = filter_input( INPUT_GET, 'current-step', FILTER_SANITIZE_STRING ); $this->current_step = ! empty( $current_step ) ? $current_step : current( array_keys( $this->wizard_steps ) ); /** * Enqueue Styles. */ wp_enqueue_style( 'mwpal-wizard-css', trailingslashit( MWPAL_BASE_URL ) . 'assets/css/dist/mwpal-setup-wizard.build.css', array( 'dashicons', 'install', 'forms' ), filemtime( trailingslashit( MWPAL_BASE_DIR ) . 'assets/css/dist/mwpal-setup-wizard.build.css' ) ); /** * Save Wizard Settings. */ $save_step = filter_input( INPUT_POST, 'save_step', FILTER_SANITIZE_STRING ); if ( ! empty( $save_step ) && ! empty( $this->wizard_steps[ $this->current_step ]['save'] ) ) { call_user_func( $this->wizard_steps[ $this->current_step ]['save'] ); } ob_start(); $this->setup_page_header(); $this->setup_page_steps(); $this->setup_page_content(); $this->setup_page_footer(); exit; } /** * Setup Page Header. */ private function setup_page_header() { ?> >
 ); ?>assets/img/wsal-logo-full.png)
' . esc_html__( 'Getting Started Guide', 'mwp-al-ext' ) . '' ); ?>
activity_log->settings->set_wsal_child_sites( ! empty( $selected_sites ) ? $selected_sites : false ); $this->activity_log->settings->update_option( 'setup-complete', true ); wp_safe_redirect( esc_url_raw( $this->get_next_step() ) ); exit(); } }