'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.0 * @var array */ protected $supported_panels = [ 'user_admin_menu' => 'read', 'admin_menu' => 'read', ]; /** * Should we hide admin notices on this page? * * @since 2.0.0 * @var boolean */ protected $hide_admin_notices = true; /** * Should we force the admin menu into a folded state? * * @since 2.0.0 * @var boolean */ protected $fold_menu = true; /** * If this customer facing page has menu settings. * * @since 2.0.9 * @var boolean */ protected $menu_settings = false; /** * Returns the title of the page. * * @since 2.0.0 * @return string Title of the page. */ public function get_title() { return __('Switch Template', 'wp-ultimo'); } /** * Returns the title of menu for this page. * * @since 2.0.0 * @return string Menu label of the page. */ public function get_menu_title() { return __('Switch Template', 'wp-ultimo'); } /** * Registers the necessary scripts. * * @since 2.0.0 * @return void */ public function register_scripts(): void { do_action('wu_template_switching_admin_page_scripts', null, null); } /** * Overrides the page loaded method. * * @since 2.0.0 * @return void */ public function page_loaded(): void { do_action('wu_template_switching_admin_page', null); parent::page_loaded(); } /** * Displays the content of the activation section. * * @since 2.0.0 * @return void */ public function output(): void { /* * Renders the base edit page layout, with the columns and everything else =) */ wu_get_template( 'base/centered', [ 'screen' => get_current_screen(), 'page' => $this, 'content' => '', 'labels' => [ 'updated_message' => __('Template switched successfully!', 'wp-ultimo'), ], ] ); } /** * Allow child classes to register widgets, if they need them. * * @since 1.8.2 * @return void */ public function register_widgets(): void { \WP_Ultimo\UI\Template_Switching_Element::get_instance()->as_metabox(get_current_screen()->id); } }