I am looking for a way to change the post status of some posts based on custom field value, from published to pending for example. How might this be possible?
My solution:
$post_ids = array( 1235, 1234, 1228, 1221, 1211, 1212, 1208, 1200 );
foreach($post_ids as $post_id) {
$post = array( 'ID' => $post_id, 'post_status' => 'pending' );
wp_update_post($post);
}