Force “Submit to review” when a post is updated

It is possible to stop author to publish post, and force him to Submit For Preview. Just add this code to your functions.php and you are all done.

<?php
   function take_away_publish_permissions() {
        $user = get_role('author');
        $user->add_cap('publish_posts',false);
   }
   add_action('init', 'take_away_publish_permissions' );
?>

** Updated Code **
This code shared here is for setting post status to preview or pending whenever a author update a post.

function postPending($post_ID)
 { 
     if(get_role('author'))
     {
        //Unhook this function
        remove_action('post_updated', 'postPending', 10, 3);

        return wp_update_post(array('ID' => $post_ID, 'post_status' => 'pending'));

        // re-hook this function
        add_action( 'post_updated', 'postPending', 10, 3 );
     }
 }
add_action('post_updated', 'postPending', 10, 3);

NOTE: If you are calling a function such as wp_update_post that
includes the save_post hook, your hooked function will create an infinite loop. To avoid this, unhook your function before calling the
function you need, then re-hook it afterward. For details look into this link

Leave a Comment