Hi,
it took some time but I dug deeply into it. Steps to reproduce:
Latest WordPress (5.2)
Latest Simmer 1.3.11
Theme Twentynineteen
Enable Gutenberg on recipe post type by enabling REST either in child theme or using plugin with following code:
function recipe_rest_support() {
global $wp_post_types;
//be sure to set this to the name of your post type!
$post_type_name = simmer_get_object_type();
if( isset( $wp_post_types[ $post_type_name ] ) ) {
$wp_post_types[$post_type_name]->show_in_rest = true;
// Optionally customize the rest_base or controller class
$wp_post_types[$post_type_name]->rest_base = $post_type_name;
$wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
}
}
add_action('init','recipe_rest_support',25);
Add a new recipe and save it.
Add a new ingredient.
Save as draft
Preview
You should see the new ingredient twice.
Add another ingredient. Save as draft again and click preview:
The first ingredient is saved four times, the last one twice …
Etc.
I can resolve that by disabling REST and Gutenberg, but it is a temporary hack, because I want to use Gutenberg when writing recipes.
Thanks and best regards, Greg