alleyinteractive / wp-match-blocks

Match WordPress blocks in the given content.
GNU General Public License v2.0
7 stars 1 forks source link

Allow matching blocks before or after a given block #14

Open dlh01 opened 1 month ago

dlh01 commented 1 month ago

Description

Inspired by the internal use case given here: https://l.alley.dev/7682a06198

The before and after parameters might accept an array of match_block() parameters, like

'before' => [ 'name' => 'my-plugin/my-custom-block' ],
'after' => [ 'with_innerhtml' => 'Get the whole story' ]

Use Case

As a developer, I want to be able to match the blocks in post content before or after a given block so that I can deliver the two halves of content in separate properties to a third-party application that composes the results in its own way.