WordPress.org

Make WordPress Core

Changeset 12648


Ignore:
Timestamp:
01/07/10 19:38:38 (4 years ago)
Author:
ryan
Message:

Block comments for future posts and password protected posts (when password not provided). Props filosofo. fixes #11810 for 2.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/wp-comments-post.php

    r12300 r12648  
    2828    do_action('comment_closed', $comment_post_ID); 
    2929    wp_die( __('Sorry, comments are closed for this item.') ); 
    30 } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) { 
     30} elseif ( in_array($status->post_status, array('draft', 'future', 'pending') ) ) { 
    3131    do_action('comment_on_draft', $comment_post_ID); 
    3232    exit; 
    3333} elseif ( 'trash' == $status->post_status ) { 
    3434    do_action('comment_on_trash', $comment_post_ID); 
     35    exit; 
     36} elseif ( post_password_required($comment_post_ID) ) { 
     37    do_action('comment_on_password_protected', $comment_post_ID); 
    3538    exit; 
    3639} else { 
Note: See TracChangeset for help on using the changeset viewer.