Make WordPress Core


Ignore:
Timestamp:
10/31/2015 08:12:16 PM (10 years ago)
Author:
wonderboymusic
Message:

Comments: don't auto-close comments on draft posts.

Adds unit tests.

Props solarissmoke, MikeHansenMe, nacin, rachelbaker.
Fixes #20262.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-functions.php

    r35435 r35475  
    25932593        return $open;
    25942594
     2595    // Undated drafts should not show up as comments closed.
     2596    if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) {
     2597        return $open;
     2598    }
     2599
    25952600    if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) )
    25962601        return false;
Note: See TracChangeset for help on using the changeset viewer.