[wp-trac] [WordPress Trac] #59383: Blocks: Introduce helper function to retrieve hooked blocks
WordPress Trac
noreply at wordpress.org
Tue Sep 26 11:47:33 UTC 2023
#59383: Blocks: Introduce helper function to retrieve hooked blocks
-------------------------------------------------+-------------------------
Reporter: gziolo | Owner: gziolo
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.4
Component: Themes | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests 2nd- | Focuses:
opinion needs-dev-note gutenberg-merge |
-------------------------------------------------+-------------------------
Comment (by Bernhard Reiter):
In [changeset:"56704" 56704]:
{{{
#!CommitTicketReference repository="" revision="56704"
Blocks: Have get_hooked_blocks() return blocks grouped by position.
All existing calls of `get_hooked_blocks()` in non-test code are currently
wrapped in an extra `array_keys()` call. This changeset absorbs that logic
into the function and changes the structure of the return value
accordingly.
Furthermore, this allows us to remove the extra `$relative_position`
argument (introduced in [56673]) from the function again, as the same data
can now be simply fetched via array access.
Props gziolo, spacedmonkey, mukesh27.
See #59383.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59383#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list