[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
Sat Jun 18 00:13:32 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:  Awaiting Review
Component:  Formatting                    |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  performance
------------------------------------------+------------------------------

Comment (by manfcarlo):

 The functions are definitely run twice, as it was determined to be the
 cause of the bug with the chessboard plugin as reported in #54614. I'm
 sure the opener of this issue would not have opened it if they had not
 verified that the functions run twice.

 Given the bugs it causes, using `the_content` filter is not an option.

 Additionally, the query loop block allows the post content of one post to
 be embedded within the post content of another post.

 The solution I propose is to move certain functions (`wptexturize`,
 `do_shortcode` and possibly others) out of `the_content` filter and into
 the block callback of certain blocks (paragraph block, classic block,
 heading block etc.) This will prevent them from ever being run twice on
 the same content.

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


More information about the wp-trac mailing list