Skip to content

Commit

Permalink
Block comments for future posts and password protected posts (when pa…
Browse files Browse the repository at this point in the history
…ssword not provided). Props filosofo. fixes #11810 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@12647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed Jan 7, 2010
1 parent 4c92a63 commit c0bbf8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wp-comments-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@
} elseif ( !comments_open($comment_post_ID) ) {
do_action('comment_closed', $comment_post_ID);
wp_die( __('Sorry, comments are closed for this item.') );
} elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
} elseif ( in_array($status->post_status, array('draft', 'future', 'pending') ) ) {
do_action('comment_on_draft', $comment_post_ID);
exit;
} elseif ( 'trash' == $status->post_status ) {
do_action('comment_on_trash', $comment_post_ID);
exit;
} elseif ( post_password_required($comment_post_ID) ) {
do_action('comment_on_password_protected', $comment_post_ID);
exit;
} else {
do_action('pre_comment_on_post', $comment_post_ID);
}
Expand Down

0 comments on commit c0bbf8c

Please sign in to comment.