Changeset 53645 for branches/6.0/src/wp-includes/blocks/post-template.php
- Timestamp:
- 07/04/2022 12:08:32 PM (3 years ago)
- Location:
- branches/6.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0
-
branches/6.0/src/wp-includes/blocks/post-template.php
r53381 r53645 83 83 while ( $query->have_posts() ) { 84 84 $query->the_post(); 85 86 // Get an instance of the current Post Template block. 87 $block_instance = $block->parsed_block; 88 89 // Set the block name to one that does not correspond to an existing registered block. 90 // This ensures that for the inner instances of the Post Template block, we do not render any block supports. 91 $block_instance['blockName'] = 'core/null'; 92 93 // Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling 94 // `render_callback` and ensure that no wrapper markup is included. 85 95 $block_content = ( 86 96 new WP_Block( 87 $block ->parsed_block,97 $block_instance, 88 98 array( 89 99 'postType' => get_post_type(), … … 92 102 ) 93 103 )->render( array( 'dynamic' => false ) ); 94 $post_classes = implode( ' ', get_post_class( 'wp-block-post' ) ); 95 $content .= '<li class="' . esc_attr( $post_classes ) . '">' . $block_content . '</li>'; 104 105 // Wrap the render inner blocks in a `li` element with the appropriate post classes. 106 $post_classes = implode( ' ', get_post_class( 'wp-block-post' ) ); 107 $content .= '<li class="' . esc_attr( $post_classes ) . '">' . $block_content . '</li>'; 96 108 } 97 109
Note: See TracChangeset
for help on using the changeset viewer.