How to display InnerBlocks in render callback


I have a block that copies the functionality of the “Columns” block. My problem is that I don’t want to use the default save function, but to use a callback function.
As I’m using InnerBlocks
my edit looks something like this

edit: ( props, setAttributes, className ) => {
   template={ getColumnsTemplate( props.attributes.columns ) }
   allowedBlocks={ ALLOWED_BLOCKS } />

By default, the save function outputs the content using this as return: <InnerBlocks.Content />

How the render_callback function in php should look like in order to display the InnerBlocks content?

Also if save returns null then the content I put inside block doesn’t get saved.

Razvan Cuceu 4 years 2019-11-05T16:42:39-05:00 0 Answers 105 views 0

Leave an answer