[wp-trac] [WordPress Trac] #60906: Block Hooks: Allow adding toggle without injecting hooked block
WordPress Trac
noreply at wordpress.org
Wed Apr 3 11:56:41 UTC 2024
#60906: Block Hooks: Allow adding toggle without injecting hooked block
-----------------------------+------------------------------
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):
I think this functionality should become available once we fix #59574 and
#60756, which we’re tentatively planning for WP 6.6.
The ''tl;dr'' is that the toggle would infer its presence, its activation
status, and the desired insertion position from the
`metadata.ignoredHookedBlocks` attribute on the anchor block. If the
hooked block is present in that array, the toggle will be present too; the
toggle’s activation status is then simply determined by the presence or
absence of the hooked block in the specified location.
This means that it’s possible to have the toggle displayed and set to
disabled by injecting the `ignoredHookedBlocks` attribute into the markup,
but not the hooked block itself. We probably don’t currently have an API
surface for that (so it’d need to be done manually) but might add
something.
Note that the technical feasibility doesn't imply that we've decided that
Core ''should'' support this; I know @joen had some thoughts on the
related User Experience.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60906#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list