[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
Thu May 9 19:50:31 UTC 2024


#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:  flixos90
     Type:  defect (bug)               |      Status:  assigned
 Priority:  normal                     |   Milestone:  Future Release
Component:  Formatting                 |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  2nd-opinion needs-refresh  |     Focuses:  performance
---------------------------------------+-----------------------------
Changes (by joemcgill):

 * keywords:  2nd-opinion => 2nd-opinion needs-refresh


Comment:

 I've been reviewing this ticket again today, and [comment:39 this
 proposal] from @flixos90  and the [https://github.com/WordPress/wordpress-
 develop/pull/5188 related PR] specifically, in light of
 https://github.com/WordPress/gutenberg/issues/61454#issuecomment-2101325926.

 I think it makes a lot of sense to introduce a filter for post-processing
 all of the blocks rendered as part of a block template rather than hard-
 coding this functionality into `get_the_block_template_html()`. In block
 themes, the entire template essentially becomes block content.

 Implementing a filter in `get_the_block_template_html()` seems like the
 appropriate place for this. Even so, doing so will not fix the bug
 described in this ticket, which I think is still a valid problem to try to
 solve for default filters, but it is a step in that direction.

 The PR needs a refresh but looks pretty good to me.

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


More information about the wp-trac mailing list