/** * Output the menu editor page * * @return void */ function page_menu_editor() { if (!$this->current_user_can_edit_menu()) { wp_die(sprintf('You do not have sufficient permissions to use Admin Menu Editor. Required: <code>%s</code>.', htmlentities($this->options['plugin_access']))); } $action = isset($this->post['action']) ? $this->post['action'] : (isset($this->get['action']) ? $this->get['action'] : ''); do_action('admin_menu_editor-header', $action); if (!empty($action)) { $this->handle_form_submission($this->post, $action); } //By default, show the "Hide" button only if the user has already hidden something with it, //or if they're using the free version. Pro users should use role permissions instead, but can //explicitly enable the button if they want. if (!isset($this->options['show_deprecated_hide_button'])) { if ($this->is_pro_version()) { $this->options['show_deprecated_hide_button'] = ameMenu::has_hidden_items($this->merged_custom_menu); $this->save_options(); } else { $this->options['show_deprecated_hide_button'] = true; } } $sub_section = isset($this->get['sub_section']) ? $this->get['sub_section'] : null; if ($sub_section === 'settings') { $this->display_plugin_settings_ui(); } else { if ($sub_section == 'generate-menu-dashicons') { require dirname(__FILE__) . '/generate-menu-dashicons.php'; } else { $this->display_editor_ui(); } } }