I am trying to figure out if there is a way to change the status of a post to private after a comment has been submitted. More specifically 3 comments, I do already have some code made up and would like to add this function within it. Would it be possible for me to hook it in this code some how?
global $post,$current_user;
$args = array( 'post_id' => $post->ID );
$comment = get_comments( $args );
get_currentuserinfo();
if ($post->post_author == $current_user->ID && 3 <= count( $comment ) ){
echo do_shortcode( '[button]' );
} elseif ( 3 <= count( $comment ) ) {
//blank
} else {
comment_form();
}
comment_post
action or thecomments_open
filter should get you going in the right direction, though.