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 gave the Contributor role edit_published_posts capability. Contributor submits a post, Admin publishes it. Now Contributor can edit it without approval. Is there a way to force it to be re-approved by Admin?

share|improve this question

1 Answer 1

you can use 'wp_insert_post_data' hook to check if the user is not an admin, and if the post status is allready "published" change it to "pending":

add_filter('wp_insert_post_data','re_aprove');
function re_aprove($data , $postarr){
    global $current_user;
    get_currentuserinfo();
    //check if current user is not admin
    if (!current_user_can('manage_options')){ 
        if ($data['post_status'] = "publish"){
            $data['post_status'] = "pending";
        }
    }
    return $data;
}
share|improve this answer
1  
But then the post disappears from public view... –  soulseekah Jan 21 '13 at 20:32

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.