Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a few custom post types which i don't want any contribute to view or touch. However, the default settings allows contributes to see these in their admin. How do i disallow contributes access to certain post types?

share|improve this question

migrated from stackoverflow.com Sep 15 '11 at 22:11

This question came from our site for professional and enthusiast programmers.

    
belongs on wordpress.se –  Daniel A. White Sep 15 '11 at 13:18
    
Not going to help? Just click 'close'? –  dotty Sep 15 '11 at 13:28

1 Answer 1

up vote 1 down vote accepted

When you register your post type you can show/hide the UI in the arguments. I would approach it this way:

$allowed = current_user_can('administrator') ? true : false;
$args = array(
    //other args
    'show_ui' => $allowed
);
//register_post_type() function;

This will maintain the custom post type architecture while hiding the UI for those who are not administrators. For more information about Wordpress User Capabilities see this page: http://codex.wordpress.org/Roles_and_Capabilities

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.