How to set "manage categories" capabilities on a post type taxonomy but not on the general categories?

admin2025-01-07  4

I want to set "manage_categories" capabilities on a post_type taxonomy but not on the general categories?

I've added to register_taxonomy:

        'manage_terms'          => 'manage_categories',
        'edit_terms'            => 'manage_categories',
        'delete_terms'          => 'manage_categories',
        'assign_terms'          => 'read'
        'edit_post'             => 'edit_video',
        'read_post'             => 'read_video',
        'delete_post'           => 'delete_video',
        'delete_others_videos'  => 'delete_others_videos',
        'edit_posts'            => 'edit_videos',
        'edit_others_posts'     => 'edit_others_videos',
        'publish_posts'         => 'publish_videos',
        'read_private_posts'    => 'read_private_videos',

How do I prevent this user from managing the general site's categories and edit only these post type taxonomies categories?

What should I add? Thanks

I want to set "manage_categories" capabilities on a post_type taxonomy but not on the general categories?

I've added to register_taxonomy:

        'manage_terms'          => 'manage_categories',
        'edit_terms'            => 'manage_categories',
        'delete_terms'          => 'manage_categories',
        'assign_terms'          => 'read'
        'edit_post'             => 'edit_video',
        'read_post'             => 'read_video',
        'delete_post'           => 'delete_video',
        'delete_others_videos'  => 'delete_others_videos',
        'edit_posts'            => 'edit_videos',
        'edit_others_posts'     => 'edit_others_videos',
        'publish_posts'         => 'publish_videos',
        'read_private_posts'    => 'read_private_videos',

How do I prevent this user from managing the general site's categories and edit only these post type taxonomies categories?

What should I add? Thanks

Share Improve this question asked Sep 27, 2016 at 6:06 Rani EinavRani Einav 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

you can just define your own capabilities to use this taxonomie

    'manage_terms'          => 'manage_terms_TAXONOMIE_NAME',
    'edit_terms'            => 'edit_terms_TAXONOMIE_NAME',
    'delete_terms'          => 'delete_terms_TAXONOMIE_NAME',
    'assign_terms'          => 'assign_terms_TAXONOMIE_NAME',

and after you choose wich capabilities you give to your users

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736255109a257.html

最新回复(0)