| @@ -145,10 +145,14 @@ | ||
| 145 | 145 | |
| 146 | 146 | // Get all registered routes |
| 147 | 147 | $routes = gutenberg_get_guidelines_wp_admin_routes(); |
| 148 | 148 | |
| 149 | - // 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. | |
| 150 | 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 | + } | |
| 151 | 155 | if ( file_exists( $asset_file ) ) { |
| 152 | 156 | $asset = require $asset_file; |
| 153 | 157 | |
| 154 | 158 | // This script serves two purposes: |
| @@ -282,9 +286,9 @@ | ||
| 282 | 286 | padding-bottom: 0; |
| 283 | 287 | } |
| 284 | 288 | |
| 285 | 289 | /* Hide legacy admin elements */ |
| 286 | - body.js #wpbody-content > div:not(.boot-layout-container):not(#screen-meta) { | |
| 290 | + body.js #wpbody-content > div:not(#guidelines-wp-admin-app):not(#screen-meta) { | |
| 287 | 291 | display: none; |
| 288 | 292 | } |
| 289 | 293 | body.js #wpfooter { |
| 290 | 294 | display: none; |
| @@ -323,8 +327,13 @@ | ||
| 323 | 327 | array( 'type' => 'error' ) |
| 324 | 328 | ); |
| 325 | 329 | ?> |
| 326 | 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 | + ?> | |
| 327 | 336 | <div id="guidelines-wp-admin-app" class="boot-layout-container"></div> |
| 328 | 337 | <?php |
| 329 | 338 | } |
| 330 | 339 | |
| @@ -329,5 +338,4 @@ | ||
| 329 | 338 | } |
| 330 | 339 | |
| 331 | 340 | // Hook the enqueue function to admin_enqueue_scripts |
| 332 | 341 | add_action( 'admin_enqueue_scripts', 'gutenberg_guidelines_wp_admin_enqueue_scripts' ); |
| 333 | - | |