WP5.0 Table block in template/Innerblocks
-
Wordpress 5.0 makes it possible to create templates prepopulated with a specific type and number of blocks.
I’m trying to build a custom block (for recipes) via a template for Innerblocks, setting predefined attributes and placeholders for each block. E.g. one of the heading blocks in my Innerblocks, is set to be a h3 a specific block style and the placeholder ‘Enter recipe title’ like this:
['core/heading', { placeholder: 'Enter recipe title...', level: 3, className: 'is-style-line-heading'}],
However, I cannot figure out how to modify the initial state of a table block in the template. I want the table block to automatically have 2 columns and 4 rows when the custom block is inserted. I tried looking at the table block’s source code, but it only made me more confused.
- Does anyone know how to achieve this?
- Alternatively, can anyone point me in the direction of documentation/tutorials that write more about predefined attributes for templates/Innerblocks
- Or, is there are better place to ask this question?
Thank you!
- The topic ‘WP5.0 Table block in template/Innerblocks’ is closed to new replies.