[wp-trac] [WordPress Trac] #62716: Block Hooks: Absorb logic to set ignored hooked blocks post meta into `apply_block_hooks_to_content`
WordPress Trac
noreply at wordpress.org
Wed Feb 19 14:50:24 UTC 2025
#62716: Block Hooks: Absorb logic to set ignored hooked blocks post meta into
`apply_block_hooks_to_content`
---------------------------------------+------------------------------
Reporter: Bernhard Reiter | Owner: Bernhard Reiter
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.8
Component: General | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch gutenberg-merge | Focuses:
---------------------------------------+------------------------------
Changes (by Bernhard Reiter):
* owner: (none) => Bernhard Reiter
* status: new => 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/62716#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list