PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 19.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v19.0
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / admin / menu / class-menu.php

class-menu.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 19.0, at admin/menu/class-menu.php

101 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPSEO plugin file.
4 *
5 * @package WPSEO\Admin\Menu
6 */
7
8 /**
9 * Registers the regular admin menu and network admin menu implementations.
10 */
11 class WPSEO_Menu implements WPSEO_WordPress_Integration {
12
13 /**
14 * The page identifier used in WordPress to register the admin page.
15 *
16 * !DO NOT CHANGE THIS!
17 *
18 * @var string
19 */
20 const PAGE_IDENTIFIER = 'wpseo_dashboard';
21
22 /**
23 * List of classes that add admin functionality.
24 *
25 * @var array
26 */
27 protected $admin_features;
28
29 /**
30 * Registers all hooks to WordPress.
31 *
32 * @return void
33 */
34 public function register_hooks() {
35 $admin_menu = new WPSEO_Admin_Menu( $this );
36 $admin_menu->register_hooks();
37
38 if ( WPSEO_Utils::is_plugin_network_active() ) {
39 $network_admin_menu = new WPSEO_Network_Admin_Menu( $this );
40 $network_admin_menu->register_hooks();
41 }
42
43 $capability_normalizer = new WPSEO_Submenu_Capability_Normalize();
44 $capability_normalizer->register_hooks();
45 }
46
47 /**
48 * Returns the main menu page identifier.
49 *
50 * @return string Page identifier to use.
51 */
52 public function get_page_identifier() {
53 return self::PAGE_IDENTIFIER;
54 }
55
56 /**
57 * Loads the requested admin settings page.
58 *
59 * @return void
60 */
61 public function load_page() {
62 $page = filter_input( INPUT_GET, 'page' );
63 $this->show_page( $page );
64 }
65
66 /**
67 * Shows an admin settings page.
68 *
69 * @param string $page Page to display.
70 *
71 * @return void
72 */
73 protected function show_page( $page ) {
74 switch ( $page ) {
75 case 'wpseo_tools':
76 require_once WPSEO_PATH . 'admin/pages/tools.php';
77 break;
78
79 case 'wpseo_titles':
80 require_once WPSEO_PATH . 'admin/pages/metas.php';
81 break;
82
83 case 'wpseo_social':
84 require_once WPSEO_PATH . 'admin/pages/social.php';
85 break;
86
87 case 'wpseo_licenses':
88 require_once WPSEO_PATH . 'admin/pages/licenses.php';
89 break;
90
91 case 'wpseo_files':
92 require_once WPSEO_PATH . 'admin/views/tool-file-editor.php';
93 break;
94
95 default:
96 require_once WPSEO_PATH . 'admin/pages/dashboard.php';
97 break;
98 }
99 }
100 }
101