How to display InnerBlocks in render callback

Question

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 ) => {
.
.
.
<InnerBlocks
   template={ getColumnsTemplate( props.attributes.columns ) }
   templateLock="all"
   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.

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

Leave an answer

Browse
Browse