[wp-trac] [WordPress Trac] #60854: Block Hooks: Allow insertion as first or last child of Template Part block

WordPress Trac noreply at wordpress.org
Wed Mar 27 17:11:00 UTC 2024


#60854: Block Hooks: Allow insertion as first or last child of Template Part block
-----------------------------+----------------------------
 Reporter:  Bernhard Reiter  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Future Release
Component:  General          |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+----------------------------
 In [https://github.com/WordPress/gutenberg/pull/57754 GB#57754], a
 mechanism was introduced to allow insertion of hooked blocks into the
 Navigation block, in particular as its `first_child` or `last_child`, thus
 fixing #59743. The latter was achieved by storing the
 `ignoredHookedBlocks` array in the corresponding `wp_navigation` post's
 post meta (instead of a `metadata` attribute on the anchor block).

 This technique could be applied to other blocks that fetch their inner
 blocks from a separate DB record (rather than having them stored inline);
 these are sometimes referred to as "controlled inner blocks".

 There might not be a large number of container blocks with controlled
 inner blocks into which we'd want to inject hooked blocks; however,
 there's at least one obvious example: The Template Part block. It's
 currently not possible to inject a hooked block as its first or last
 child.

 Note however that the code that inserts hooked blocks into the Navigation
 block's `wp_navigation` post objects currently lives in Gutenberg.
 Consequently, it's advisable to absorb that code into Core first (i.e. to
 fix #60759) before tackling this issue.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60854>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list