wordpress set post draft code example
Example: move post to draft php wordpress
$post = array( 'ID' => $post_id, 'post_status' => $status );
wp_update_post($post);
$post = array( 'ID' => $post_id, 'post_status' => $status );
wp_update_post($post);