I created a custom post type called gdpr_qao
and I set 'capability_type' => array( 'gdpr_qao', 'gdpr_qsaos' )
in register_post_type arguments. On main custom post type screen I get:
Notice: Undefined property: stdClass::$delete_posts in
/srv/www/wp-plugins/public_html/wp-admin/includes/class-wp-posts-list-table.php
on line 411
and in bulk actions there isn’t delete option.
How can I solve this problem?
Here the custom post type code:
public function register_gdpr_qao() {
$labels = array(
'name' => _x( 'Problemi & Pareri GDPR', 'post type general name', 'ccwdpo' ),
'singular_name' => _x( 'Problema & Parere GDPR', 'post type singular name', 'ccwdpo' ),
'menu_name' => _x( 'Problemi & Pareri', 'admin menu', 'ccwdpo' ),
'name_admin_bar' => _x( 'Problemi & Pareri GDPR', 'add new on admin bar', 'ccwdpo' ),
'add_new' => _x( 'Aggiungi nuovo', 'quesito', 'ccwdpo' ),
'add_new_item' => __( 'Nuovo Problema & Parere', 'ccwdpo' ),
'new_item' => __( 'Nuovo P&P', 'ccwdpo' ),
'edit_item' => __( 'Modifica Problema & Parere', 'ccwdpo' ),
'view_item' => __( 'Visualizza P&P', 'ccwdpo' ),
'all_items' => __( 'Tutti i Problemi & Pareri', 'ccwdpo' ),
'search_items' => __( 'Cerca P&P', 'ccwdpo' ),
'parent_item_colon' => __( 'Genitori dei P&P:', 'ccwdpo' ),
'not_found' => __( 'Nessun Problema & Parere trovato.', 'ccwdpo' ),
'not_found_in_trash' => __( 'Nessun Problema & Parere trovato nel Cestino.', 'ccwdpo' )
);
$args = array(
'labels' => $labels,
'description' => __( 'Descrizione.', 'ccwdpo' ),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'gdpr-qao' ),
'capability_type' => array( 'gdpr_qao', 'gdpr_qsaos' ),
//'map_meta_cap' => true,
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 6,
//'menu_icon' => 'data:image/svg+xml;base64,',
'supports' => array( 'title', 'editor', 'author' ),
'taxonomies' => array( 'gdpr_category', 'gpdr_area_of_interest' )
);
register_post_type( 'gdpr_qao', $args );
}