Is there a way to check the Published status of a post, and if it doesnt has at least one image or file uploaded, then change status of published to draft?
Thanks in advance.
I didn't test this, but it should work:
function check_post_attachments($post_id, $post){
if(empty(get_posts(array('post_type' => 'attachment', 'post_parent' => $post_id)))){
$post['post_status'] = 'draft';
wp_update_post($post);
}
}
add_action('save_post', 'check_post_attachments');