Guides
Custom Post Type and Save in Meta control
When you decided to use blocks with Save in Meta
option inside Custom Post Types, make sure, your post type supports custom fields.
How to register custom post type with custom-fields support:
PHP
function create_my_custom_post_type() {
register_post_type(
'my_custom_post',
array(
'labels' => array(
'name' => __( 'My Custom Post' ),
'singular_name' => __( 'My Custom Post' )
),
'public' => true,
// THIS IS IMPORTANT PART
// to enable Gutenberg editor.
'show_in_rest' => true,
'supports' => array(
'title',
'editor',
'thumbnail',
// THIS IS IMPORTANT PART
// to add support for custom meta fields.
'custom-fields',
),
)
);
}
add_action( 'init', 'create_my_custom_post_type' );