From 84e1baca546d306f5215d960e1d1927593038f65 Mon Sep 17 00:00:00 2001 From: antpb Date: Fri, 19 May 2023 20:07:02 -0500 Subject: [PATCH 1/2] 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 d1343249ed6509..16a5be0202152d 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; From f3999b52d882ace95d4472e8de606db23958c9c2 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 03:35:03 +0200 Subject: [PATCH 2/2] Fix wrong conflict resolution when cherry picking --- packages/block-library/src/template-part/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/template-part/index.php b/packages/block-library/src/template-part/index.php index 16a5be0202152d..84c9dadb7493c1 100644 --- a/packages/block-library/src/template-part/index.php +++ b/packages/block-library/src/template-part/index.php @@ -135,7 +135,7 @@ function render_block_core_template_part( $attributes ) { unset( $seen_ids[ $template_part_id ] ); $content = wptexturize( $content ); $content = convert_smilies( $content ); - $content = wp_filter_content_tags( $content, "template_part_{$area}" ); + $content = wp_filter_content_tags( $content ); // Handle embeds for block template parts. global $wp_embed;