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
This commit is contained in:
Jonathan Desrosiers 2023-05-20 04:03:23 +00:00
parent 65eaadf2bb
commit 73de8ad1ab
4 changed files with 28 additions and 26 deletions

38
package-lock.json generated
View File

@ -3797,9 +3797,9 @@
}
},
"@wordpress/block-library": {
"version": "6.0.29",
"resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-6.0.29.tgz",
"integrity": "sha512-Wr5NIeyDbGgrOSH8V5cdRW9N6hI+OVZcSHfAEyMl0nDpVUTyGLsotGdVK1A+QHQHOFKANgBKqwmxbMKT/2IQyg==",
"version": "6.0.30",
"resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-6.0.30.tgz",
"integrity": "sha512-mXG4a5kH9mHQ9JtkbSyOABdK0KfbNCs+s2HzlAQ82DqSNnwKuYqQKYjpBgdD3cyLk7CIZTjz02wxMAc+p/qqNw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
@ -3978,14 +3978,14 @@
}
},
"@wordpress/customize-widgets": {
"version": "2.0.30",
"resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-2.0.30.tgz",
"integrity": "sha512-nJveEWuiiLhZ/zOPFcgavpPlLpq3ob7R5JVI52LNQJXWrdBE68gh5udVpSv1HmVY5FgrKiWTIVZCdZYD2hYFAg==",
"version": "2.0.31",
"resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-2.0.31.tgz",
"integrity": "sha512-VkJww51L5NI3qjrw7p+pcUWKWie3Z7sNfyGMBUUuCDZxMHJMl8fb5k5IFJxFgV0nyesG8EVEexpiI7xqIlQ/lw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/block-editor": "^8.0.18",
"@wordpress/block-library": "^6.0.29",
"@wordpress/block-library": "^6.0.30",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.2.3",
"@wordpress/compose": "^5.0.7",
@ -4130,15 +4130,15 @@
}
},
"@wordpress/edit-post": {
"version": "5.0.30",
"resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-5.0.30.tgz",
"integrity": "sha512-SnvgP+TCTmaD1CT+66KG/21ykfLotmn4Hx0K0O2kYjEsw5LwvzFFgx3yWmo+vLi5zEe6Z8Rm+QvSfq6xXobL6w==",
"version": "5.0.31",
"resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-5.0.31.tgz",
"integrity": "sha512-/FJ8OytoFoQBvIciLjL6SH31dE/nV5ir3FFrlaDu/+SMV8nKBH2gGS0BD7bTjqyhRXz9wQ0M+ivNPgVBsj2HGw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.7",
"@wordpress/block-editor": "^8.0.18",
"@wordpress/block-library": "^6.0.29",
"@wordpress/block-library": "^6.0.30",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.2.3",
"@wordpress/compose": "^5.0.7",
@ -4175,15 +4175,15 @@
}
},
"@wordpress/edit-site": {
"version": "3.0.30",
"resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-3.0.30.tgz",
"integrity": "sha512-XS60gWnzgprqiM79++PDY4MrpqUJkhM/AJ8tccLIFJEPsdAYziM/Ok5LKHYP9uFN0A/ScgDT9Zo7jk/ILchO7g==",
"version": "3.0.31",
"resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-3.0.31.tgz",
"integrity": "sha512-BQw1vlrvhlfn4quTu3F208U8a4rWjW/+TqrRe41N31TmrCrQZgqgPJRBKvE3ypYncTd9zL6zKunmXy7XC5Yzdw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.7",
"@wordpress/block-editor": "^8.0.18",
"@wordpress/block-library": "^6.0.29",
"@wordpress/block-library": "^6.0.30",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.2.3",
"@wordpress/compose": "^5.0.7",
@ -4216,15 +4216,15 @@
}
},
"@wordpress/edit-widgets": {
"version": "3.1.25",
"resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-3.1.25.tgz",
"integrity": "sha512-s00vTrHAgXmOwwfX3WRu80doHfk8Lhk5lxxc0ESbZeGQjWvy0eNgT0mpHuA+AYH2yiojt/xVwWW4NBIWMF+YIA==",
"version": "3.1.26",
"resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-3.1.26.tgz",
"integrity": "sha512-rdYG1kprYZqxlSle2Wd8FE/+XxqQWm1PfLYGAuXTHG2ywtb6yU9D+T+VdDJPiOGc51moogFD+vbCLnHpXrLYUw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.7",
"@wordpress/block-editor": "^8.0.18",
"@wordpress/block-library": "^6.0.29",
"@wordpress/block-library": "^6.0.30",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.2.3",
"@wordpress/compose": "^5.0.7",

View File

@ -84,22 +84,22 @@
"@wordpress/blob": "3.2.2",
"@wordpress/block-directory": "3.0.30",
"@wordpress/block-editor": "8.0.18",
"@wordpress/block-library": "6.0.29",
"@wordpress/block-library": "6.0.30",
"@wordpress/block-serialization-default-parser": "4.2.3",
"@wordpress/blocks": "11.1.5",
"@wordpress/components": "19.2.3",
"@wordpress/compose": "5.0.7",
"@wordpress/core-data": "4.0.11",
"@wordpress/customize-widgets": "2.0.30",
"@wordpress/customize-widgets": "2.0.31",
"@wordpress/data": "6.1.5",
"@wordpress/data-controls": "2.2.9",
"@wordpress/date": "4.2.3",
"@wordpress/deprecated": "3.2.3",
"@wordpress/dom": "3.2.7",
"@wordpress/dom-ready": "3.2.3",
"@wordpress/edit-post": "5.0.30",
"@wordpress/edit-site": "3.0.30",
"@wordpress/edit-widgets": "3.1.25",
"@wordpress/edit-post": "5.0.31",
"@wordpress/edit-site": "3.0.31",
"@wordpress/edit-widgets": "3.1.26",
"@wordpress/editor": "12.0.22",
"@wordpress/element": "4.0.4",
"@wordpress/escape-html": "2.2.3",

View File

@ -237,6 +237,8 @@ function get_the_block_template_html() {
$content = $wp_embed->run_shortcode( $_wp_current_template_content );
$content = $wp_embed->autoembed( $content );
$content = shortcode_unautop( $content );
$content = do_shortcode( $content );
$content = do_blocks( $content );
$content = wptexturize( $content );
$content = convert_smilies( $content );

View File

@ -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 );
// Handle embeds for block template parts.
global $wp_embed;