[wp-trac] [WordPress Trac] #60580: Block Hooks: Allow hooked_block filter(s) to return null
WordPress Trac
noreply at wordpress.org
Tue Feb 20 11:19:46 UTC 2024
#60580: Block Hooks: Allow hooked_block filter(s) to return null
-----------------------------+------------------------------
Reporter: Bernhard Reiter | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by Bernhard Reiter):
One thing to consider when implementing this is that it somewhat muddles
the invariant that only the `hooked_block_types` filter can change
''which'' hooked blocks are slated for insertion, whereas the
`hooked_block` (and `hooked_block_{$hooked_block_type}`) filter cannot --
the latter have so far only been able to modify a given hooked block's
attributes, inner blocks, etc.
This might be okay. We just need to be mindful of correctly setting
`ignoredHookedBlocks` if `hooked_block` or
`hooked_block_{$hooked_block_type}` returns `null`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60580#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list