Skip to content

Commit

Permalink
Move var assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Oct 30, 2024
1 parent cca359d commit bace479
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.7/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
3 changes: 1 addition & 2 deletions lib/compat/wordpress-6.8/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down

0 comments on commit bace479

Please sign in to comment.