Adding post tags without capability edit_posts
Adding post tags without capability edit_posts
Adding post tags without capability edit_posts
“edit_published_posts” and “edit_other_post” issue
add_role user capability not working
Usage of current_user_can()
I resolved this by adding checks via the “content_edit_pre” WP hook. I quickly check on the status of the post and if it is already pending I return the user back to the post listing page and then show an error. // Redirect edit post page back to the list page when pending add_action( ‘content_edit_pre’, … Read more
So to answer my question… I don’t know if it is the best approach: In the custom post type I added capabilities to which only admin has priviliges like so: ‘capabilities’=>array( ‘edit_post’=>’update_core’, ‘read_post’=>’update_core’, ‘delete_post’=>’update_core’, ‘edit_posts’=>’update_core’, ‘edit_others_posts’=>’update_core’, ‘publish_posts’=>’update_core’, ‘read_private_posts’=>’update_core’ ), And then I also did that for custom taxonomies like so: ‘capabilities’=>array( ‘manage_terms’=>’manage_options’, ‘edit_terms’=>’manage_options’, ‘delete_terms’=>’manage_options’, ‘assign_terms’=>’manage_options’, … Read more
Where are $current_user->allcaps set?
Allow user to only access custom post type
Cannot Create new Post within Custom Post Type
As linked to in the other comment by @AXheladini; you will need to set up Roles and/or Capabilities. Once that is done use the function current_user_can() (codex page) to allow or deny the actual page.