if ( 'core/template-part' ===
$block['blockName'
] &&
!
isset( $block['attrs'
]['theme'
] ) ) { $block['attrs'
]['theme'
] =
get_stylesheet();
$has_updated_content = true;
} } if ( $has_updated_content ) { foreach ( $template_blocks as &
$block ) { $new_content .=
serialize_block( $block );
} return $new_content;
} return $template_content;
}/**
* Parses a block template and removes the theme attribute from each template part.
*
* @since 5.9.0
* @access private
*
* @param string $template_content Serialized block template content.
* @return string Updated block template content.
*/