Skip to content

Commit 9f4b52d

Browse files
committed
Update Core code to avoid the nesting problem
1 parent fb3c62d commit 9f4b52d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/wp-includes/block-template-utils.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ function _inject_theme_attribute_in_template_part_block( &$block ) {
543543
'core/template-part' === $block['blockName'] &&
544544
! isset( $block['attrs']['theme'] )
545545
) {
546-
$block['attrs']['theme'] = get_stylesheet();
546+
$attrs = $block['attrs'];
547+
$attrs['theme'] = get_stylesheet();
547548
}
548549
}
549550

‎src/wp-includes/blocks/navigation.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,8 @@ function block_core_navigation_typographic_presets_backcompatibility( $parsed_bl
12001200
foreach ( $attribute_to_prefix_map as $style_attribute => $prefix ) {
12011201
if ( ! empty( $parsed_block['attrs']['style']['typography'][ $style_attribute ] ) ) {
12021202
$prefix_len = strlen( $prefix );
1203-
$attribute_value = &$parsed_block['attrs']['style']['typography'][ $style_attribute ];
1203+
$attrs = $parsed_block['attrs'];
1204+
$attribute_value = &$attrs['style']['typography'][ $style_attribute ];
12041205
if ( 0 === strncmp( $attribute_value, $prefix, $prefix_len ) ) {
12051206
$attribute_value = substr( $attribute_value, $prefix_len );
12061207
}

0 commit comments

Comments
 (0)