Skip to content

Commit 73de8ad

Browse files
committed
Editor: Restore shortcode support for block templates.
Follow up to [55761]. Props youknowriad, Clorith, desrosj, antpb, Otto42, johnbillion, jorbin, rmccue, timothyblynjacobs, mikeschroder, peterwilsoncc, audrasjb, matveb, noisysocks, xknown, ehtis, isabel_brison, talldanwp, gziolo, chriscct7, davidbaumwald. Merges [55828] to the 5.9 branch. See #58333. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@55832 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 65eaadf commit 73de8ad

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

package-lock.json

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@
8484
"@wordpress/blob": "3.2.2",
8585
"@wordpress/block-directory": "3.0.30",
8686
"@wordpress/block-editor": "8.0.18",
87-
"@wordpress/block-library": "6.0.29",
87+
"@wordpress/block-library": "6.0.30",
8888
"@wordpress/block-serialization-default-parser": "4.2.3",
8989
"@wordpress/blocks": "11.1.5",
9090
"@wordpress/components": "19.2.3",
9191
"@wordpress/compose": "5.0.7",
9292
"@wordpress/core-data": "4.0.11",
93-
"@wordpress/customize-widgets": "2.0.30",
93+
"@wordpress/customize-widgets": "2.0.31",
9494
"@wordpress/data": "6.1.5",
9595
"@wordpress/data-controls": "2.2.9",
9696
"@wordpress/date": "4.2.3",
9797
"@wordpress/deprecated": "3.2.3",
9898
"@wordpress/dom": "3.2.7",
9999
"@wordpress/dom-ready": "3.2.3",
100-
"@wordpress/edit-post": "5.0.30",
101-
"@wordpress/edit-site": "3.0.30",
102-
"@wordpress/edit-widgets": "3.1.25",
100+
"@wordpress/edit-post": "5.0.31",
101+
"@wordpress/edit-site": "3.0.31",
102+
"@wordpress/edit-widgets": "3.1.26",
103103
"@wordpress/editor": "12.0.22",
104104
"@wordpress/element": "4.0.4",
105105
"@wordpress/escape-html": "2.2.3",

src/wp-includes/block-template.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ function get_the_block_template_html() {
237237

238238
$content = $wp_embed->run_shortcode( $_wp_current_template_content );
239239
$content = $wp_embed->autoembed( $content );
240+
$content = shortcode_unautop( $content );
241+
$content = do_shortcode( $content );
240242
$content = do_blocks( $content );
241243
$content = wptexturize( $content );
242244
$content = convert_smilies( $content );

src/wp-includes/blocks/template-part.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ function render_block_core_template_part( $attributes ) {
128128
}
129129

130130
// Run through the actions that are typically taken on the_content.
131+
$content = shortcode_unautop( $content );
132+
$content = do_shortcode( $content );
131133
$seen_ids[ $template_part_id ] = true;
132134
$content = do_blocks( $content );
133135
unset( $seen_ids[ $template_part_id ] );
134136
$content = wptexturize( $content );
135137
$content = convert_smilies( $content );
136-
$content = shortcode_unautop( $content );
137138
$content = wp_filter_content_tags( $content );
138-
$content = do_shortcode( $content );
139139

140140
// Handle embeds for block template parts.
141141
global $wp_embed;

0 commit comments

Comments
 (0)