Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For one of my custom post types I want a specific user to be able to edit existing posts created by admin but not be able to Add New posts.

How can this be done?

If I define the user role as not being able to Publish it still allows them to add a new post and submit for review.

share|improve this question

1 Answer

up vote 3 down vote accepted

You will have to do something like this:

function hide_buttons() {
    global $current_screen;

    if($current_screen->id == 'edit-post' && !current_user_can('publish_posts')) {
        echo '<style>.add-new-h2{display: none;}</style>';  
    }
}
add_action('admin_head','hide_buttons');

See: http://erisds.co.uk/wordpress/spotlight-wordpress-admin-menu-remove-add-new-pages-or-posts-link for reference

share|improve this answer
Perfect, thanks – fxfuture Sep 29 '10 at 22:49
You are welcome. – sorich87 Sep 29 '10 at 23:37

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.