Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2661
    [email protected]
    Participant

    I am trying to restrict Custom Post Type ‘Testimonials’ for the contributor level but there is no option to do so. I’ve upgraded to the Pro version hoping that this would offer this easy option but it did not. Can you help me out here? Thanks.

    #2666
    Vladimir
    Keymaster

    Often custom post types are protected with the same capabilities set as the built-in posts: edit_posts, edit_others_posts, etc.

    In order to check what capabilities are in use for the custom post type you may use “Admin menu access” add-on.
    Activate it and open for ‘Administrator’ role. Found ‘Testimonials’ at the list of menu items opened. Look what it’s shown at the ‘User capability’ column.

    Other way to check selected post type capabilities is to add this code to the functions.php and look at its output at the admin page HTML source:

    
    add_action('admin_head', 'debug_output');
    
    function debug_output() {
        $post_type = get_post_type_object('post'); // replace post with custom post type ID if needed
        echo '<!--start debug---' . PHP_EOL;
        print_r($post_type->cap);
        echo '---stop debug-->' . PHP_EOL;
    }
    

    If it uses its own capability, like ‘edit_testimonials’, just grant/revoke them with URE.
    If it uses ‘edit_posts’, etc. you have 2 options:
    1) block access to other post types blocking access to their menu items via “Admin menu access” module.
    2) Activate “Force custom post types to use their own capabilities” option at the “Settings->User Role Editor->Additional Modules” tab. Any custom post type (including reserved one, like ‘attachment’ will use its own capabilities set.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.