← All changes
|
_inc/lib/admin-pages/class.jetpack-settings-page.php
+10
-6
16.2-beta
→
16.3-a.5
View file →
| @@ -37,15 +37,17 @@ | ||
| 37 | 37 | * Adds the Settings sub menu. |
| 38 | 38 | */ |
| 39 | 39 | public function get_page_hook() { |
| 40 | 40 | /* |
| 41 | - * In Offline Mode the cloud dashboard and My Jetpack don't initialize, so | |
| 42 | - * surface the Modules page as a visible, first-position item under the | |
| 43 | - * Jetpack top-level menu. This makes the top-level "Jetpack" menu land on | |
| 44 | - * Modules (instead of the first cloud page, e.g. AI) while leaving the | |
| 45 | - * "Settings" item free to point at the real settings dashboard. | |
| 41 | + * In Offline Mode My Jetpack does not initialize, so nothing holds the top slot and | |
| 42 | + * WordPress points the top-level "Jetpack" link at whichever item sorts first. Pin | |
| 43 | + * Modules above the alphabetical run so that link lands here rather than on whatever | |
| 44 | + * feature page happens to sort first. Only reachable offline, where My Jetpack's -10 | |
| 45 | + * is never registered. | |
| 46 | 46 | */ |
| 47 | 47 | if ( ( new Status() )->is_offline_mode() ) { |
| 48 | + $position = defined( Admin_Menu::class . '::POSITION_FIRST_FALLBACK' ) ? Admin_Menu::POSITION_FIRST_FALLBACK : -5; | |
| 49 | + | |
| 48 | 50 | return Admin_Menu::add_menu( |
| 49 | 51 | __( 'Jetpack Settings', 'jetpack' ), |
| 50 | 52 | __( 'Modules', 'jetpack' ), |
| 51 | 53 | 'jetpack_manage_modules', |
| @@ -50,9 +52,9 @@ | ||
| 50 | 52 | __( 'Modules', 'jetpack' ), |
| 51 | 53 | 'jetpack_manage_modules', |
| 52 | 54 | 'jetpack_modules', |
| 53 | 55 | array( $this, 'render' ), |
| 54 | - 1 | |
| 56 | + $position | |
| 55 | 57 | ); |
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | return add_submenu_page( |
| @@ -112,8 +114,10 @@ | ||
| 112 | 114 | } |
| 113 | 115 | echo $noscript_notice; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 114 | 116 | ?> |
| 115 | 117 | |
| 118 | + <!-- Core relocates other plugins' notices to just after this marker. --> | |
| 119 | + <div class="wrap"><div class="wp-header-end"></div></div> | |
| 116 | 120 | <div class="jetpack-module-list"> |
| 117 | 121 | <?php if ( $is_offline_mode ) : ?> |
| 118 | 122 | <div class="wrap"> |
| 119 | 123 | <div class="jetpack-offline-notice"> |