Notice: Undefined property: stdClass::$delete_posts
-
I create custom post type with:
$capabilities = array( 'edit_post' => 'edit_khoahoc', 'read_post' => 'read_khoahoc', 'delete_post' => 'delete_khoahoc', 'edit_posts' => 'edit_khoahoc', 'edit_others_posts' => 'edit_others_khoahoc', 'publish_posts' => 'publish_khoahoc', 'read_private_posts' => 'read_private_khoahoc', );
but it return Notice:
Notice: Undefined property: stdClass::$delete_posts in \wp-admin\includes\class-wp-posts-list-table.php on line 403
Pls, tel me why and how to make fine?
Full code:
function khoahoc_func() { $labels = array( 'name' => _x( 'Khóa h?c', 'Post Type General Name', 'devvn' ), 'singular_name' => _x( 'Khóa h?c', 'Post Type Singular Name', 'devvn' ), 'menu_name' => __( 'Khóa h?c', 'devvn' ), 'name_admin_bar' => __( 'Khóa h?c', 'devvn' ), 'archives' => __( 'Khóa h?c', 'devvn' ), 'attributes' => __( 'Item Attributes', 'devvn' ), 'parent_item_colon' => __( 'Parent Item:', 'devvn' ), 'all_items' => __( 'All Items', 'devvn' ), 'add_new_item' => __( 'Add New Item', 'devvn' ), 'add_new' => __( 'Add New', 'devvn' ), 'new_item' => __( 'New Item', 'devvn' ), 'edit_item' => __( 'Edit Item', 'devvn' ), 'update_item' => __( 'Update Item', 'devvn' ), 'view_item' => __( 'View Item', 'devvn' ), 'view_items' => __( 'View Items', 'devvn' ), 'search_items' => __( 'Search Item', 'devvn' ), 'not_found' => __( 'Not found', 'devvn' ), 'not_found_in_trash' => __( 'Not found in Trash', 'devvn' ), 'featured_image' => __( 'Featured Image', 'devvn' ), 'set_featured_image' => __( 'Set featured image', 'devvn' ), 'remove_featured_image' => __( 'Remove featured image', 'devvn' ), 'use_featured_image' => __( 'Use as featured image', 'devvn' ), 'insert_into_item' => __( 'Insert into item', 'devvn' ), 'uploaded_to_this_item' => __( 'Uploaded to this item', 'devvn' ), 'items_list' => __( 'Items list', 'devvn' ), 'items_list_navigation' => __( 'Items list navigation', 'devvn' ), 'filter_items_list' => __( 'Filter items list', 'devvn' ), ); $rewrite = array( 'slug' => 'khoa-hoc', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $capabilities = array( 'edit_post' => 'edit_khoahoc', 'read_post' => 'read_khoahoc', 'delete_post' => 'delete_khoahoc', 'edit_posts' => 'edit_khoahoc', 'edit_others_posts' => 'edit_others_khoahoc', 'publish_posts' => 'publish_khoahoc', 'read_private_posts' => 'read_private_khoahoc', ); $args = array( 'label' => __( 'Khóa h?c', 'devvn' ), 'description' => __( 'Th?ng tin Khóa h?c', 'devvn' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', ), 'taxonomies' => array( 'chuong_trinh' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-welcome-learn-more', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capabilities' => $capabilities, ); register_post_type( 'khoa_hoc', $args ); } add_action( 'init', 'khoahoc_func', 0 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Notice: Undefined property: stdClass::$delete_posts’ is closed to new replies.