From bace479a86c5915a20e5ded8fbdb66b00a69c4c6 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 30 Oct 2024 12:12:34 +1100 Subject: [PATCH] Move var assignment --- lib/compat/wordpress-6.7/rest-api.php | 2 +- lib/compat/wordpress-6.8/rest-api.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/compat/wordpress-6.7/rest-api.php b/lib/compat/wordpress-6.7/rest-api.php index 05b237ec8a7e1b..741d0ad1805e07 100644 --- a/lib/compat/wordpress-6.7/rest-api.php +++ b/lib/compat/wordpress-6.7/rest-api.php @@ -53,13 +53,13 @@ function gutenberg_block_editor_preload_paths_6_7( $paths, $context ) { // Preload theme and global styles paths. if ( 'core/edit-site' === $context->name || 'core/edit-post' === $context->name ) { $active_theme = get_stylesheet(); - $excluded_paths = array(); $global_styles_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id(); $paths[] = '/wp/v2/global-styles/themes/' . $active_theme . '?context=view'; $paths[] = '/wp/v2/global-styles/themes/' . $active_theme . '/variations?context=view'; $paths[] = array( '/wp/v2/global-styles/' . $global_styles_id, 'OPTIONS' ); // Remove duplicate or unnecessary global styles paths. + $excluded_paths = array(); $excluded_paths[] = '/wp/v2/global-styles/themes/' . $active_theme; $excluded_paths[] = '/wp/v2/global-styles/' . $global_styles_id; foreach ( $paths as $key => $path ) { diff --git a/lib/compat/wordpress-6.8/rest-api.php b/lib/compat/wordpress-6.8/rest-api.php index 88701e3327df75..8eaf449fd2f1e8 100644 --- a/lib/compat/wordpress-6.8/rest-api.php +++ b/lib/compat/wordpress-6.8/rest-api.php @@ -20,9 +20,8 @@ function gutenberg_block_editor_preload_paths_6_8( $paths, $context ) { // Preload theme and global styles paths. if ( 'core/edit-site' === $context->name || 'core/edit-post' === $context->name ) { - $excluded_paths = array(); $global_styles_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id(); - + $excluded_paths = array(); /* * Removes any edit or view context paths originating from Core, * or elsewhere, e.g., gutenberg_block_editor_preload_paths_6_6().