Skip to content

Commit

Permalink
Update Core code to avoid the nesting problem
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Jan 30, 2024
1 parent a4f068d commit 2aa6d3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/wp-includes/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ function _inject_theme_attribute_in_template_part_block( &$block ) {
'core/template-part' === $block['blockName'] &&
! isset( $block['attrs']['theme'] )
) {
$block['attrs']['theme'] = get_stylesheet();
$attrs = $block['attrs'];
$attrs['theme'] = get_stylesheet();
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/blocks/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,8 @@ function block_core_navigation_typographic_presets_backcompatibility( $parsed_bl
foreach ( $attribute_to_prefix_map as $style_attribute => $prefix ) {
if ( ! empty( $parsed_block['attrs']['style']['typography'][ $style_attribute ] ) ) {
$prefix_len = strlen( $prefix );
$attribute_value = &$parsed_block['attrs']['style']['typography'][ $style_attribute ];
$attrs = $parsed_block['attrs'];
$attribute_value = &$attrs['style']['typography'][ $style_attribute ];
if ( 0 === strncmp( $attribute_value, $prefix, $prefix_len ) ) {
$attribute_value = substr( $attribute_value, $prefix_len );
}
Expand Down

0 comments on commit 2aa6d3e

Please sign in to comment.