admin管理员组

文章数量:1317915

I have a custom user role I've set up that has access only to 1 specific custom post type and nothing else ( no access to post, pages etc. ).

I've got it working however I can't seem to figure out how to give the custom role capabilities to edit, create, delete, and assign custom taxonomies of that custom post type. (regular wp user roles such as admin have no problem editing the custom taxonomy)

This is what I have: ( 'doc' is the name of my custom post type and 'doctype' is the taxonomy)

if I add 'edit_posts' => true,'manage_categories' => true, I can edit, create, etc the custom tax but I get all other post types and post and more.

add_role( 'customuser', 'Custom User', 
    array(
    'read' => true,
    'edit_doc' => true,
    'edit_docs' => true,
    'edit_published_docs' => true,
    'edit_others_doc' => true,
    'edit_others_docs' => true,
    'delete_doc' => true,
    'delete_published_docs' => true,
    'publish_docs' => true,
) 
);

How can I get the custom user to not only have access to the custom post type but also be able to edit it's custom tax without allowing access to other post types and posts

本文标签: Adding user capabilities for a custom taxonomy of a custom post type for a custom user