Skip to content

Commit

Permalink
Template Part block: Guard against get_block_file_template returnin…
Browse files Browse the repository at this point in the history
…g `null` (WordPress#69309)

Co-authored-by: ockham <[email protected]>
Co-authored-by: paulopmt1 <[email protected]>
Co-authored-by: josephscott <[email protected]>
  • Loading branch information
4 people authored Feb 25, 2025
1 parent db71531 commit ac34493
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/template-part/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function render_block_core_template_part( $attributes ) {
if ( 0 === validate_file( $attributes['slug'] ) ) {
$block_template = get_block_file_template( $template_part_id, 'wp_template_part' );

$content = $block_template->content;
if ( isset( $block_template->content ) ) {
$content = $block_template->content;
}
if ( isset( $block_template->area ) ) {
$area = $block_template->area;
}
Expand Down

0 comments on commit ac34493

Please sign in to comment.