CPT capabilities not working as expected
-
Hello!
I am into a new project that needs a custom post type and a new user role.
These new users will have some cpt posts assign to them by the adminsTwo things need there
1) the users must see only their cpt posts
2) users must be able too view their posts but not to edit them or create newso here are the capabilities in ctp args
'capabilities' => array( 'publish_posts' => 'publish_cpts', 'edit_posts' => 'edit_cpts', 'edit_others_posts' => 'edit_others_cpts', 'delete_posts' => 'delete_cpts', 'delete_others_posts' => 'delete_others_cpts', 'read_private_posts' => 'read_private_cpts', 'edit_post' => 'edit_cpt', 'delete_post' => 'delete_cpt', 'read_post' => 'read_cpt' )
so with these caps at ctp, i assigned to the new user role
1) read (default cap so user can view wp-admin)
2) read_cptproblems:
1) to be able the user to view the cpt posts, the “edit_cpts” must be assigned for some reason that i do not understand… the read_cpt will not work
2) if the “edit_cpts” is assigned then the user is able to see the others users postscan someone explain me if these caps are working that way or i did not get something right
ps i would prefer not using a pre_post hook to get the result i want to…
Thnaks
- The topic ‘CPT capabilities not working as expected’ is closed to new replies.