Make WordPress Core

Opened 4 months ago

Last modified 10 days ago

#61446 assigned enhancement

Move content processing in get_the_block_template_html() to filters.

Reported by: joemcgill's profile joemcgill Owned by: joemcgill's profile joemcgill
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

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 (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 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.

Change History (2)

This ticket was mentioned in Slack in #core-performance by joemcgill. View the logs.


4 months ago

#2 @davidbaumwald
10 days ago

  • Milestone changed from 6.7 to Future Release

With 6.7 Beta 1 releasing in a few hours, this is being moved to Future Release given no implementation or patch exist just yet.

If any committer feels the remaining work can be resolved in time for Beta 1 or any other specific milestone and wishes to assume ownership during that cycle, feel free to update the milestone accordingly.

Note: See TracTickets for help on using tickets.