| @@ -86,11 +86,12 @@ | ||
| 86 | 86 | * Automatically called during page rendering. |
| 87 | 87 | */ |
| 88 | 88 | function gutenberg_experiments_wp_admin_preload_data() { |
| 89 | 89 | // Define paths to preload - same for all pages |
| 90 | - // Please also change packages/core-data/src/entities.js when changing this. | |
| 90 | + // This must exactly match the _fields list in packages/core-data/src/entities.js, | |
| 91 | + // same fields in the same order, or the preload is never consumed. | |
| 91 | 92 | $preload_paths = array( |
| 92 | - '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', | |
| 93 | + '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', | |
| 93 | 94 | array( '/wp/v2/settings', 'OPTIONS' ), |
| 94 | 95 | ); |
| 95 | 96 | |
| 96 | 97 | // Use rest_preload_api_request to gather the preloaded data |
| @@ -144,10 +145,14 @@ | ||
| 144 | 145 | |
| 145 | 146 | // Get all registered routes |
| 146 | 147 | $routes = gutenberg_get_experiments_wp_admin_routes(); |
| 147 | 148 | |
| 148 | - // Get boot module asset file for dependencies | |
| 149 | + // Get boot module asset file for dependencies. Plugins that build their own | |
| 150 | + // boot module use it; everyone else falls back to the copy bundled with Core. | |
| 149 | 151 | $asset_file = __DIR__ . '/../../modules/boot/index.min.asset.php'; |
| 152 | + if ( ! file_exists( $asset_file ) ) { | |
| 153 | + $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; | |
| 154 | + } | |
| 150 | 155 | if ( file_exists( $asset_file ) ) { |
| 151 | 156 | $asset = require $asset_file; |
| 152 | 157 | |
| 153 | 158 | // This script serves two purposes: |
| @@ -268,25 +273,25 @@ | ||
| 268 | 273 | |
| 269 | 274 | #wpwrap { |
| 270 | 275 | overflow-y: auto; |
| 271 | 276 | } |
| 272 | - body { | |
| 277 | + body.js { | |
| 273 | 278 | background: #fff; |
| 274 | 279 | } |
| 275 | 280 | |
| 276 | 281 | /* Reset wp-admin padding */ |
| 277 | - #wpcontent { | |
| 282 | + body.js #wpcontent { | |
| 278 | 283 | padding-inline-start: 0; |
| 279 | 284 | } |
| 280 | - #wpbody-content { | |
| 285 | + body.js #wpbody-content { | |
| 281 | 286 | padding-bottom: 0; |
| 282 | 287 | } |
| 283 | 288 | |
| 284 | 289 | /* Hide legacy admin elements */ |
| 285 | - #wpbody-content > div:not(.boot-layout-container):not(#screen-meta) { | |
| 290 | + body.js #wpbody-content > div:not(#experiments-wp-admin-app):not(#screen-meta) { | |
| 286 | 291 | display: none; |
| 287 | 292 | } |
| 288 | - #wpfooter { | |
| 293 | + body.js #wpfooter { | |
| 289 | 294 | display: none; |
| 290 | 295 | } |
| 291 | 296 | |
| 292 | 297 | /* Accessibility regions */ |
| @@ -313,8 +318,22 @@ | ||
| 313 | 318 | overflow-y: initial; |
| 314 | 319 | } |
| 315 | 320 | } |
| 316 | 321 | </style> |
| 322 | + <div class="wrap hide-if-js"> | |
| 323 | + <h1 class="wp-heading-inline"><?php echo esc_html( get_admin_page_title() ); ?></h1> | |
| 324 | + <?php | |
| 325 | + wp_admin_notice( | |
| 326 | + __( 'This screen requires JavaScript. Enable JavaScript in your browser settings and reload the page.' ), | |
| 327 | + array( 'type' => 'error' ) | |
| 328 | + ); | |
| 329 | + ?> | |
| 330 | + </div> | |
| 331 | + <?php | |
| 332 | + // Core's pre-CSS Modules Boot layout uses this class for viewport sizing. | |
| 333 | + // Remove it when the minimum supported WordPress version includes the Boot | |
| 334 | + // changes from Gutenberg #81756. | |
| 335 | + ?> | |
| 317 | 336 | <div id="experiments-wp-admin-app" class="boot-layout-container"></div> |
| 318 | 337 | <?php |
| 319 | 338 | } |
| 320 | 339 | |
| @@ -319,5 +338,4 @@ | ||
| 319 | 338 | } |
| 320 | 339 | |
| 321 | 340 | // Hook the enqueue function to admin_enqueue_scripts |
| 322 | 341 | add_action( 'admin_enqueue_scripts', 'gutenberg_experiments_wp_admin_enqueue_scripts' ); |
| 323 | - | |