[wp-trac] [WordPress Trac] #59646: Block Hooks: Enable for user-modified templates/parts/patterns

WordPress Trac noreply at wordpress.org
Wed Oct 18 19:30:55 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:"56970" 56970]:
 {{{
 #!CommitTicketReference repository="" revision="56970"
 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.

 See #59646.
 Props gziolo.
 Fixes #59669.
 }}}

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


More information about the wp-trac mailing list