From 84e1baca546d306f5215d960e1d1927593038f65 Mon Sep 17 00:00:00 2001 From: antpb Date: Fri, 19 May 2023 20:07:02 -0500 Subject: [PATCH] Process template part shortcodes before blocks (#50801) * Process shortcodes before processing blocks so that dynamic blocks, by default, do not have shortcodes expanded * Revert "Process shortcodes before processing blocks so that dynamic blocks, by default, do not have shortcodes expanded" This reverts commit 00374e02f40c6a70f561609393023f3a7695662c. * Process shortcodes before processing blocks so that dynamic blocks, by default, do not have shortcodes expanded --- packages/block-library/src/template-part/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/template-part/index.php b/packages/block-library/src/template-part/index.php index d1343249ed650..16a5be0202152 100644 --- a/packages/block-library/src/template-part/index.php +++ b/packages/block-library/src/template-part/index.php @@ -128,14 +128,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 ); - $content = do_shortcode( $content ); + $content = wp_filter_content_tags( $content, "template_part_{$area}" ); // Handle embeds for block template parts. global $wp_embed;