[wp-trac] [WordPress Trac] #59572: Block Hooks: Allow passing block definitions
WordPress Trac
noreply at wordpress.org
Mon Oct 9 14:46:06 UTC 2023
#59572: Block Hooks: Allow passing block definitions
-----------------------------+-----------------------------
Reporter: Bernhard Reiter | Owner: Bernhard Reiter
Type: enhancement | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
Currently, it is only possible to specify a block name for automatic
insertion via Block Hooks; this means the block will be inserted in its
"default" state (i.e. with no way of specifying custom attributes or inner
blocks). This is true for both registering a hooked block via the
`blockHooks` field `block.json`, or via the `hooked_block_types` filter
(introduced in [56673]).
We might want to allow providing a full, parsed-block style, block
definition:
{{{#!php
array( 'mycommerce/mini-cart', array(
'isPreview' => true,
'miniCartIcon' => 'bag',
) )
}}}
Props @ndiego for pointing out this shortcoming to me.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59572>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list