Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#59385 closed defect (bug) (fixed)

Blocks: Implement block insertion functions

Reported by: bernhard-reiter's profile Bernhard Reiter Owned by: bernhard-reiter's profile Bernhard Reiter
Milestone: 6.4 Priority: normal
Severity: normal Version:
Component: General Keywords: commit
Focuses: Cc:

Description (last modified by Bernhard Reiter)

For #59313, we need to implement functions to insert a given parsed block into another parsed block's inner blocks, and to prepend and append to that array, respectively.

We will use those functions in combination with traverse_and_serialize_blocks (see #59327) to implement automatic insertion of hooked blocks into block templates and patterns.

Change History (7)

#1 @Bernhard Reiter
12 months ago

  • Description modified (diff)

#2 @Bernhard Reiter
12 months ago

  • Summary changed from Blocks: Implement `insert_hooked_block(s)` to Blocks: Implement block insertion functions

#3 @Bernhard Reiter
12 months ago

  • Description modified (diff)

#4 @Bernhard Reiter
12 months ago

  • Description modified (diff)

#5 @Bernhard Reiter
12 months ago

  • Keywords commit added

#6 @Bernhard Reiter
12 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 56618:

Blocks: Implement block insertion functions.

For #59313, we need to implement functions to insert a given parsed block into another parsed block's inner blocks, and to prepend and append to that array, respectively.

We will use those functions in combination with traverse_and_serialize_blocks (see #59327) to implement automatic insertion of hooked blocks into block templates and patterns.

Props gziolo.
Fixes #59385.

#7 @Bernhard Reiter
12 months ago

In 56634:

Blocks: Revert implementation of block insertion functions.

In [56618], three functions (insert_inner_block, prepend_inner_block, and append_inner_block) were introduced. They were meant to be used for insertion of hooked blocks; however, it was discovered that the original idea wouldn't work for sibling insertion. Instead, a different approach will be taken (see #59412), and these functions are no longer needed and can thus be removed.

Reverts [56618].
See #59412, #59385, #59313.

Note: See TracTickets for help on using tickets.