[wp-trac] [WordPress Trac] #61074: Block Hooks: Enable for post content

WordPress Trac noreply at wordpress.org
Wed Feb 19 14:50:24 UTC 2025


#61074: Block Hooks: Enable for post content
---------------------------------------------+-----------------------------
 Reporter:  Bernhard Reiter                  |       Owner:  Bernhard
                                             |  Reiter
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.8
Component:  General                          |     Version:
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  needs-dev-note, gutenberg-merge  |     Focuses:
---------------------------------------------+-----------------------------
Changes (by Bernhard Reiter):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"59838" 59838]:
 {{{
 #!CommitTicketReference repository="" revision="59838"
 Block Hooks: Add function to encapsulate wrapping in ad-hoc parent.

 Introduce a new function, `apply_block_hooks_to_content_from_post_object`,
 to colocate the logic used to temporarily wrap content in a parent block
 (with `ignoredHookedBlocks` information fetched from post meta) alongside
 the call to `apply_block_hooks_to_content`. Fetching that information from
 post meta is required for all block types that get their content from post
 objects, i.e. Post Content, Synced Pattern, and Navigation blocks.

 Additionally, the newly introduced function contains logic to ensure that
 insertion of a hooked block into the `first_child` or `last_child`
 position of a given Post Content block works, even if that block only
 contains "classic" markup (i.e. no blocks).

 Props bernhard-reiter, gziolo, mamaduka.
 Fixes #61074, #62716.
 }}}

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


More information about the wp-trac mailing list