You are not allowed to move this item to the trash even if delete_posts is true

$args = array(
            'label' => __('orders', $text_domain),
            'description' => __('Orders', $text_domain),
            'labels' => $labels,
            'supports' => array('title', 'editor', 'excerpt', 'revisions', 'custom-fields'),
            'hierarchical' => false,
            'public' => false,
            'show_ui' => true,
            'show_in_menu' => true,
            'show_in_nav_menus' => true,
            'show_in_admin_bar' => true,
            'menu_position' => 5,
            'menu_icon' => 'dashicons-clipboard',
            'can_export' => false,
            'has_archive' => false,
            'exclude_from_search' => true,
            'publicly_queryable' => false,
            'capability_type' => 'post',
            'capabilities' => array(
                'create_posts' => false, // Removes support for the "Add New" function
                'delete_posts' => true,
                // 'edit_posts' => false, // Removes support for the "Add New" function
            ),
            'map_meta_cap' => true,
        );

I have this in arguments, it has capabilities delete_posts set to true. However I get the message: You are not allowed to move this item to the Trash. when I try to delete any item. What is solution?

Related posts