From 7dfb3b03abe879499eaef4068ee3e7a8f1446cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor?= <27339341+priethor@users.noreply.github.com> Date: Sat, 20 May 2023 04:06:29 +0200 Subject: [PATCH] Process template part shortcodes before blocks (#50801) (#50806) * Process shortcodes before processing blocks so that dynamic blocks, by default, do not have shortcodes expanded Co-authored-by: antpb --- packages/block-library/src/template-part/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/template-part/index.php b/packages/block-library/src/template-part/index.php index e12f67566a0fd..d3de7d0b3afbd 100644 --- a/packages/block-library/src/template-part/index.php +++ b/packages/block-library/src/template-part/index.php @@ -143,14 +143,14 @@ function render_block_core_template_part( $attributes ) { } // Run through the actions that are typically taken on the_content. + $content = shortcode_unautop( $content ); + $content = do_shortcode( $content ); $seen_ids[ $template_part_id ] = true; $content = do_blocks( $content ); unset( $seen_ids[ $template_part_id ] ); $content = wptexturize( $content ); $content = convert_smilies( $content ); - $content = shortcode_unautop( $content ); $content = wp_filter_content_tags( $content, "template_part_{$area}" ); - $content = do_shortcode( $content ); // Handle embeds for block template parts. global $wp_embed;