I am using wp user frontend, and I have also downloaded a plugin called 'WP-Reportpost'.
What I am trying to do is that I want users to add post with WP User Frontend (which is working), but when a post get more then 3 reports from other users it should change it status from 'Published' too 'Pending'.
I am trying to make a function in functions.php, but I can't get the code to work. So far I got this:
/* Set posts to pending */
function change_post_status($post_id,$status){
$current_post = get_post( $post_id, 'ARRAY_A' );
$current_post['post_status'] = $status;
wp_update_post($current_post);
}
and in reports.php I have put this code:
if(count($report) >= 3){
change_post_status($report->postID,'pending');
}
The the post still has status as 'Published' and not 'Pending'.
Any tips?