However, it would be very useful to have this data available. I have 2 use cases.
I have a partially dynamic block. I am saving my block as HTML in the post content. But I want a small part of this to be modified.
I have a container block with nested children. The block is rendered in PHP. I have no way to get the child block data.
There are alternative ways to achive these goals. I could have my dynamic block fully rendered in PHP. I could just allow my container block to store all the data in the post content. However this isn't very flexible.
The text was updated successfully, but these errors were encountered:
For two of the examples I provided above, it is also necessary to have the ability to pass child block objects into a render callback. Member content, for example, should be able to contain any number of blocks, and then conditionally choose whether to render them or not. This functionality is currently possible with nested shortcodes, so should not be regressed by moving to Gutenberg blocks.
The referenced PR does not appear to include this functionality.
Passing the content to the render callback was re-added in #8077, it'll be released in Gutenberg 3.4. 🙂
Passing the child block objects is a little trickier, and will likely require replacing the current do_blocks() regex with a much faster parser. See #8244 for an overview ticket of the various approaches towards that.