I am trying & learning to build custom block for Gutenberg but spent a few hours on searching for full list of "available options". Maybe I was overlook...
Refer: Template and Block
For example, placeholder
& align
are options but what else?
function myplugin_register_book_post_type() {
$args = array(
'public' => true,
'label' => 'Books',
'show_in_rest' => true,
'template' => array(
array( 'core/image', array(
'align' => 'left',
) ),
array( 'core/heading', array(
'placeholder' => 'Add Author...',
) ),
array( 'core/paragraph', array(
'placeholder' => 'Add Description...',
) ),
),
);
register_post_type( 'book', $args );
}
add_action( 'init', 'myplugin_register_book_post_type' );
Example 2:
those empty array()
should be allow to store some options, right?
$template = array(
array( 'core/paragraph', array(
'placeholder' => 'Add a root-level paragraph',
)),
array( 'core/columns', array(), array(
array( 'core/column', array(), array(
array( 'core/image', array() ),
)),
array( 'core/column', array(), array(
array( 'core/paragraph', array(
'placeholder' => 'Add a inner paragraph'
)),
)),
))
);