diff --git src/wp-includes/block-template.php src/wp-includes/block-template.php
index affae1c09a..4cd7d5b691 100644
|
|
|
function get_the_block_template_html() { |
| 259 | 259 | $content = $wp_embed->run_shortcode( $_wp_current_template_content ); |
| 260 | 260 | $content = $wp_embed->autoembed( $content ); |
| 261 | 261 | $content = shortcode_unautop( $content ); |
| | 262 | $line_break_placeholder = function( $shortcode_output ) { |
| | 263 | return str_replace( "\n", '<!-- wp-block-theme-line-break-placeholder -->', $shortcode_output ); |
| | 264 | }; |
| | 265 | add_filter( 'do_shortcode_tag', $line_break_placeholder, 100 ); |
| 262 | 266 | $content = do_shortcode( $content ); |
| 263 | | |
| | 267 | remove_filter( 'do_shortcode_tag', $line_break_placeholder, 100 ); |
| 264 | 268 | /* |
| 265 | 269 | * Most block themes omit the `core/query` and `core/post-template` blocks in their singular content templates. |
| 266 | 270 | * While this technically still works since singular content templates are always for only one post, it results in |
| … |
… |
function get_the_block_template_html() { |
| 297 | 301 | $content = wptexturize( $content ); |
| 298 | 302 | $content = convert_smilies( $content ); |
| 299 | 303 | $content = wp_filter_content_tags( $content, 'template' ); |
| | 304 | $content = str_replace( '<!-- wp-block-theme-line-break-placeholder -->', "\n", $content ); |
| 300 | 305 | $content = str_replace( ']]>', ']]>', $content ); |
| 301 | 306 | |
| 302 | 307 | // Wrap block template in .wp-site-blocks to allow for specific descendant styles |
diff --git src/wp-includes/blocks/template-part.php src/wp-includes/blocks/template-part.php
index c73b644087..07ad2c8ac0 100644
|
|
|
function render_block_core_template_part( $attributes ) { |
| 151 | 151 | |
| 152 | 152 | // Run through the actions that are typically taken on the_content. |
| 153 | 153 | $content = shortcode_unautop( $content ); |
| | 154 | $line_break_placeholder = function( $shortcode_output ) { |
| | 155 | return str_replace( "\n", '<!-- wp-block-theme-line-break-placeholder -->', $shortcode_output ); |
| | 156 | }; |
| | 157 | add_filter( 'do_shortcode_tag', $line_break_placeholder, 100 ); |
| 154 | 158 | $content = do_shortcode( $content ); |
| | 159 | remove_filter( 'do_shortcode_tag', $line_break_placeholder, 100 ); |
| 155 | 160 | $seen_ids[ $template_part_id ] = true; |
| 156 | 161 | $content = do_blocks( $content ); |
| 157 | 162 | unset( $seen_ids[ $template_part_id ] ); |
| 158 | 163 | $content = wptexturize( $content ); |
| 159 | 164 | $content = convert_smilies( $content ); |
| | 165 | $content = str_replace( '<!-- wp-block-theme-line-break-placeholder -->', "\n", $content ); |
| 160 | 166 | $content = wp_filter_content_tags( $content, "template_part_{$area}" ); |
| 161 | 167 | |
| 162 | 168 | // Handle embeds for block template parts. |