Skip to content

Commit

Permalink
Ensure that a theme attribute is not already assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip committed Jan 12, 2021
1 parent f0a733d commit 3b8e71b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/full-site-editing/block-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function _inject_theme_attribute_in_content( $template_content, $theme ) {

$updated_blocks = array_map(
function( $block ) use ( $theme ) {
if ( 'core/template-part' === $block['blockName'] ) {
if ( 'core/template-part' === $block['blockName'] && ! isset( $block['attrs']['theme'] ) ) {
$block['attrs']['theme'] = $theme;
}

Expand Down

0 comments on commit 3b8e71b

Please sign in to comment.