admin管理员组文章数量:1434125
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 );
}
本文标签: capabilitiesNotice Undefined property stdClassdeleteposts with custom post type
版权声明:本文标题:capabilities - Notice: Undefined property: stdClass::$delete_posts with custom post type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745619212a2666584.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论