'capability_here' * To add a page to the network admin (wp-admin/network), use: 'network_admin_menu' => 'capability_here' * To add a page to the user (wp-admin/user) admin, use: 'user_admin_menu' => 'capability_here' * * @since 2.0.24 * @var array */ protected $supported_panels = array( 'network_admin_menu' => 'manage_network', ); /** * Overrides original construct method. * * We need to override the construct method to make sure * we make the necessary changes to the Wizard page when it's * being run for the first time. * * @since 2.0.24 * @return void */ public function __construct() { parent::__construct(); } // end __construct; /** * Returns the logo for the wizard. * * @since 2.0.24 * @return string */ public function get_logo() { return wu_get_asset('logo.png', 'img'); } // end get_logo; /** * Returns the title of the page. * * @since 2.0.24 * @return string Title of the page. */ public function get_title(): string { return sprintf(__('Migration', 'wp-ultimo')); } // end get_title; /** * Returns the title of menu for this page. * * @since 2.0.24 * @return string Menu label of the page. */ public function get_menu_title() { return WP_Ultimo()->is_loaded() ? __('WP Multisite WaaS Migration Alert', 'wp-ultimo') : __('WP Multisite WaaS', 'wp-ultimo'); } // end get_menu_title; /** * Returns the sections for this Wizard. * * @since 2.0.24 * @return array */ public function get_sections() { return array( 'alert' => array( 'title' => __('Alert!', 'wp-ultimo'), 'view' => array($this, 'section_alert'), 'handler' => array($this, 'handle_proceed'), ), ); } // end get_sections; /** * Displays the content of the final section. * * @since 2.0.24 * @return void */ public function section_alert() { wu_get_template('wizards/setup/alert', array( 'screen' => get_current_screen(), 'page' => $this, )); } // end section_alert; /** * Handles the proceed action. * * @since 2.0.24 * @return void */ public function handle_proceed() { delete_network_option(null, 'wu_setup_finished'); delete_network_option(null, 'wu_is_migration_done'); wp_redirect(wu_network_admin_url('wp-ultimo-setup')); exit; } // end handle_proceed; } // end class Migration_Alert_Admin_Page;