Так работает
$labels = array(
'name' => _x( 'Продукты', 'taxonomy general name' ),
'singular_name' => _x( 'product', 'taxonomy singular name' ),
'search_items' => __( 'Search product' ),
'all_items' => __( 'All Products' ),
'parent_item' => __( 'Parent product' ),
'parent_item_colon' => __( 'Parent product:' ),
'edit_item' => __( 'Edit product' ),
'update_item' => __( 'Update product' ),
'add_new_item' => __( 'Add New product' ),
'new_item_name' => __( 'New product Name' ),
'menu_name' => __( 'Продукты' ),
);
register_post_type(
'products',
array(
'labels' => $labels,
'exclude_from_search' => false,
'has_archive' => true,
'public' => true,
'publicly_queryable' => false,
'rewrite' => false,
'can_export' => true,
'show_in_nav_menus' => true,
'supports' => array('title', 'editor', 'thumbnail', 'comments', 'page-attributes','excerpt'),
'show_in_rest' =>true,
)
);
register_taxonomy(
'product_cats',
'products',
array(
'hierarchical' => true,
'show_in_nav_menus' => true,
'labels' =>array(),
'query_var' => true,
'rewrite' => array('slug' => 'product_cats'),
'show_in_rest' => true,
)
);