最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Adding user capabilities for a custom taxonomy of a custom post type for a custom user

programmeradmin1浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论