Changeset 57377 for trunk/src/wp-includes/blocks/template-part.php
- Timestamp:
- 01/29/2024 09:04:18 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/template-part.php
r56849 r57377 44 44 // A published post might already exist if this template part was customized elsewhere 45 45 // or if it's part of a customized template. 46 $ content = $template_part_post->post_content;47 $ area_terms = get_the_terms( $template_part_post, 'wp_template_part_area' );48 if ( ! is_wp_error( $area_terms ) && false !== $area_terms) {49 $area = $ area_terms[0]->name;46 $block_template = _build_block_template_result_from_post( $template_part_post ); 47 $content = $block_template->content; 48 if ( isset( $block_template->area ) ) { 49 $area = $block_template->area; 50 50 } 51 51 /** … … 70 70 if ( isset( $block_template->area ) ) { 71 71 $area = $block_template->area; 72 } 73 74 // Needed for the `render_block_core_template_part_file` and `render_block_core_template_part_none` actions below. 75 $block_template_file = _get_block_template_file( 'wp_template_part', $attributes['slug'] ); 76 if ( $block_template_file ) { 77 $template_part_file_path = $block_template_file['path']; 72 78 } 73 79 } … … 276 282 __DIR__ . '/template-part', 277 283 array( 278 'render_callback' => 'render_block_core_template_part',279 'variation s' => build_template_part_block_variations(),284 'render_callback' => 'render_block_core_template_part', 285 'variation_callback' => 'build_template_part_block_variations', 280 286 ) 281 287 );
Note: See TracChangeset
for help on using the changeset viewer.