[wp-trac] [WordPress Trac] #55996: the get_the_block_template_html call all the same functions as the the_conent filter so they are run twice

WordPress Trac noreply at wordpress.org
Tue Nov 1 23:30:06 UTC 2022


#55996: the get_the_block_template_html call all the same functions as the
the_conent filter so they are run twice
----------------------------------------+--------------------------
 Reporter:  pbearne                     |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  6.2
Component:  Formatting                  |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:  performance
----------------------------------------+--------------------------
Changes (by flixos90):

 * keywords:  needs-patch needs-unit-tests => needs-unit-tests has-patch
 * milestone:  Awaiting Review => 6.2


Comment:

 I have opened a pull request to address this problem:
 https://github.com/WordPress/wordpress-develop/pull/3549

 The TLDR of what it does is:
 * After parsing the blocks in the block template, replace post content
 within the block template with temporary placeholders.
 * Run the other block template processing logic, which now will no longer
 unnecessarily reprocess the post content again.
 * Inject the parsed post content back into the block template.

 This change fixes the double execution of these functions on post content
 with minimal disruptions, and without attempting to significantly alter
 the approach of `get_the_block_template_html()` or to introduce new
 filters. Please have a look.

 This PR already fixes problems like #56930 as well for example.

 cc @pbearne @spacedmonkey @adamsilverstein

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55996#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list