Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address feedback about micro-optimize array merges
  • Loading branch information
oandregal committed Nov 22, 2022
commit 178cf4e44f5eb515ca0f845cbf706592c075b8c1
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ function _gutenberg_get_global_stylesheet_clean_cache_upon_upgrading( $upgrader,
*/
function gutenberg_get_global_settings( $path = array(), $context = array() ) {
if ( ! empty( $context['block_name'] ) ) {
$path = array_merge( array( 'blocks', $context['block_name'] ), $path );
$new_path = array( 'blocks', $context['block_name'] );
foreach( $path as $subpath ) {
$new_path[] = $subpath;
}
$path = $new_path;
}

// This is the default value when no origin is provided or when it is 'all'.
Expand Down