[wp-trac] [WordPress Trac] #59646: Block Hooks: Enable for user-modified templates/parts/patterns
WordPress Trac
noreply at wordpress.org
Wed Nov 1 12:44:18 UTC 2023
#59646: Block Hooks: Enable for user-modified templates/parts/patterns
-----------------------------+------------------------------
Reporter: Bernhard Reiter | Owner: Bernhard Reiter
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.5
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------------------
Comment (by Bernhard Reiter):
In [changeset:"57043" 57043]:
{{{
#!CommitTicketReference repository="" revision="57043"
Blocks: During traversal, allow post callback to modify block.
Both the `$pre_callback` and `$post_callback` functions that are given as
arguments to `traverse_and_serialize_block(s)` receive a reference to the
current block as their first argument. However, while any changes that the
"pre" callback makes to the block are reflected by the serialized markup,
the same wasn't true for the "post" callback: Any changes that it made
were only applied ''after'' the block had already been serialized.
This commit changes the behavior such that `$post_callback`'s changes to
the current block are also reflected in the serialized markup.
Reviewed by hellofromTonya.
Merges [56970] to the 6.4 branch.
See #59646.
Props gziolo.
Fixes #59669.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59646#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list