I am experiencing a strange issue.
I created a custom post type but for some reason it's not showing in the admin menu and when I am trying to access that page via url(edit.php?post_type=study_class) it says 'You donot have permission to access this page'
Here is the code
add_action('init', 'cptui_register_my_cpt_study_class');
function cptui_register_my_cpt_study_class() {
register_post_type('study_class', array(
'label' => 'Study Class',
'description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'study_class',
'capabilities' => array(
'edit_post' => 'edit_study_class',
'read_post' => 'read_study_class' ,
'delete_post' => 'delete_study_class',
'edit_posts' => 'edit_study_class' ,
'edit_others_posts' => 'edit_others_study_class',
'publish_posts' => 'publish_study_class' ,
'read_private_posts' => 'read_private_study_class',
'read' => 'read',
'delete_posts' => 'delete_study_class',
'delete_private_posts' => 'delete_private_study_class',
'delete_published_posts' => 'delete_published_study_class',
'delete_others_posts' => 'delete_others_study_class',
'edit_private_posts' => 'edit_private_study_class',
'edit_published_posts' => 'edit_published_study_class',
),
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'study_class', 'with_front' => true),
'query_var' => true,
'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','post-formats'),
'labels' => array (
'name' => 'Study Class',
'singular_name' => 'Study Class',
'menu_name' => 'Study Class',
'add_new' => 'Add New Study Class',
'add_new_item' => 'Add new Study Class',
'edit' => 'Edit',
'edit_item' => 'Edit Study Class',
'new_item' => 'New Study Class',
'view' => 'View Study Class',
'view_item' => 'View Study Class',
'search_items' => 'Search Study Class',
'not_found' => ' Study Class not found',
'not_found_in_trash' => ' Study Class not found in Trash',
'parent' => 'Parent Study Class',
)
) );
Any help is highly appreciated. Thanks in advance.
capabilities
,cability_type
andmap_meta_cap
parameters in order to switch back to defaults. – vard