[wp-trac] [WordPress Trac] #59383: Blocks: Introduce helper function to retrieve hooked blocks
WordPress Trac
noreply at wordpress.org
Mon Oct 9 16:38:42 UTC 2023
#59383: Blocks: Introduce helper function to retrieve hooked blocks
-------------------------------------------------+-------------------------
Reporter: gziolo | Owner: gziolo
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.4
Component: Themes | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note gutenberg-merge | performance
-------------------------------------------------+-------------------------
Changes (by Bernhard Reiter):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"56805" 56805]:
{{{
#!CommitTicketReference repository="" revision="56805"
Blocks: Call `get_hooked_blocks` only once per template/part/pattern.
Prior to this changeset, `get_hooked_blocks` was called four times ''for
every parsed block'' in each template, template part, and pattern. With
this changeset applied, `get_hooked_blocks` is called only once per
template, template part, or pattern.
Additionally, `get_hooked_blocks` is called only once when returning the
list of all registered patterns. (The latter modification brings the
implementation closer to its state prior to Block Hooks.)
Finally, when there are no registered hooked blocks or
`hooked_block_types` filters, parsing, hooked block insertion, and re-
serializing is skipped altogether.
Props gziolo, flixos90, joemcgill, dmsnell, spacedmonkey, hellofromtonya.
Fixes #59383.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59383#comment:49>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list