When a block saves one of its attributes to a custom meta field, that block does not work in custom post types, as the value you input will be erased on save.
You should be able to save attributes to a custom meta field in a custom block in any post type, not just the core ones.
Does the custom post type has defined support for custom-fields?
@ocean90 I just tested, and adding support for custom-fields to my custom post type fixed the issue. However, that should not be necessary, as my custom meta field was explicitly registered via register_meta and is not a user-created field… right? Do I just misunderstand the meaning of custom-fields support?
From the REST API point of view it means "post type supports meta", see https://github.com/WordPress/wordpress-develop/blob/4ac3f4c13a4eef7bc16a6bf8d29399fe55263d22/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L2034-L2036.
I guess I was mistaken then. Thanks for pointing that out, @ocean90! :smile:
Closing this issue.
Most helpful comment
Does the custom post type has defined support for
custom-fields?