PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
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
← All changes | admin/menu/class-base-menu.php +3 -25 18.5 → trunk View file →
@@ -43,11 +43,9 @@
43 43 *
44 44 * @return array Formatted submenu.
45 45 */
46 46 protected function get_submenu_page( $page_title, $page_slug, $callback = null, $hook = null ) {
47 - if ( $callback === null ) {
48 - $callback = $this->get_admin_page_callback();
49 - }
47 + $callback ??= $this->get_admin_page_callback();
50 48
51 49 return [
52 50 $this->get_page_identifier(),
53 51 '',
@@ -130,9 +128,9 @@
130 128 $submenu_page[3],
131 129 $submenu_page[4],
132 130 $submenu_page[5],
133 131 $this->get_icon_svg(),
134 - 99
132 + 99,
135 133 );
136 134
137 135 // If necessary, add hooks for the submenu page.
138 136 if ( isset( $submenu_page[6] ) && ( is_array( $submenu_page[6] ) ) ) {
@@ -163,13 +161,8 @@
163 161 */
164 162 protected function register_submenu_page( $submenu_page ) {
165 163 $page_title = $submenu_page[2];
166 164
167 - // We cannot use $submenu_page[1] because add-ons define that, so hard-code this value.
168 - if ( $submenu_page[4] === 'wpseo_licenses' ) {
169 - $page_title = $this->get_license_page_title();
170 - }
171 -
172 165 /*
173 166 * Handle the Google Search Console special case by passing a fake parent
174 167 * page slug. This way, the sub-page is stil registered and can be accessed
175 168 * directly. Its menu item won't be displayed.
@@ -187,9 +180,9 @@
187 180 $page_title,
188 181 $submenu_page[2],
189 182 $submenu_page[3],
190 183 $submenu_page[4],
191 - $submenu_page[5]
184 + $submenu_page[5],
192 185 );
193 186
194 187 // If necessary, add hooks for the submenu page.
195 188 if ( isset( $submenu_page[6] ) && ( is_array( $submenu_page[6] ) ) ) {
@@ -243,23 +236,8 @@
243 236 * @return array Callback page handler.
244 237 */
245 238 protected function get_admin_page_callback() {
246 239 return [ $this->menu, 'load_page' ];
247 - }
248 -
249 - /**
250 - * Returns the page title to use for the licenses page.
251 - *
252 - * @return string The title for the license page.
253 - */
254 - protected function get_license_page_title() {
255 - static $title = null;
256 -
257 - if ( $title === null ) {
258 - $title = __( 'Premium', 'wordpress-seo' );
259 - }
260 -
261 - return $title;
262 240 }
263 241
264 242 /**
265 243 * Returns a base64 URL for the svg for use in the menu.