[wp-trac] [WordPress Trac] #61446: Move content processing in get_the_block_template_html() to filters.

WordPress Trac noreply at wordpress.org
Fri Jun 14 15:08:32 UTC 2024


#61446: Move content processing in get_the_block_template_html() to filters.
-------------------------+-----------------------
 Reporter:  joemcgill    |      Owner:  joemcgill
     Type:  enhancement  |     Status:  assigned
 Priority:  normal       |  Milestone:  6.7
Component:  Editor       |    Version:
 Severity:  normal       |   Keywords:  has-patch
  Focuses:               |
-------------------------+-----------------------
 When `get_the_block_template_html()` was added in [51003] it hard coded
 all of the content processing that is applied in classic themes to post
 content via default filters like `the_content`, `the_excerpt`, etc. This
 includes, but is not limited, to the following processing functions:

 * `wp_embed->run_shortcode`
 * `wp_embed->autoembed`
 * `shortcode_unautop`
 * `do_shortcode`
 * `do_blocks`
 * `wptexturize`
 * `convert_smilies`
 * `wp_filter_content_tags`


 This has resulted in bugs like #55996 and also makes it impossible to run
 post processing on the full contents of a block template before it is
 rendered to the template canvas
 ([https://github.com/WordPress/gutenberg/issues/61454 example use case]).

 To address this we can introduce a new filter, `the_block_template_html`,
 and move all of the processing to that filter instead. See
 [https://github.com/WordPress/wordpress-develop/pull/6533 this PR] for an
 initial proof of concept. Sidenote: this was originally proposed as a way
 to address #55996 but is really an enhancement with broader implications,
 so a separate ticket seems warranted.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61446>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list