| @@ -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.31337' | |
| 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. |