Skip to content

Commit

Permalink
Reflect latest changes from WordPress/gutenberg#55217.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Oct 11, 2023
1 parent 62e0be6 commit 4fb3a58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/wp-includes/blocks/pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function render_block_core_pattern( $attributes ) {
// Backward compatibility for handling Block Hooks and injecting the theme attribute in the Gutenberg plugin.
// This can be removed when the minimum supported WordPress is >= 6.4.
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && ! function_exists( 'traverse_and_serialize_blocks' ) ) {
$content = _inject_theme_attribute_in_block_template_content( $content );
$blocks = parse_blocks( $content );
$content = gutenberg_serialize_blocks( $blocks );
}
Expand Down
9 changes: 2 additions & 7 deletions src/wp-includes/blocks/template-part.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ function render_block_core_template_part( $attributes ) {
$template_part_id = null;
$content = null;
$area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
$theme = isset( $attributes['theme'] ) ? $attributes['theme'] : get_stylesheet();

if ( isset( $attribues['theme'] ) ) {
$theme = $attributes['theme'];
} else {
$theme = get_stylesheet();
}

if ( isset( $attributes['slug'] ) ) {
if ( isset( $attributes['slug'] ) && get_stylesheet() === $theme ) {
$template_part_id = $theme . '//' . $attributes['slug'];
$template_part_query = new WP_Query(
array(
Expand Down

0 comments on commit 4fb3a58

Please sign in to comment.