Make WordPress Core


Ignore:
Timestamp:
05/30/2014 07:46:05 PM (12 years ago)
Author:
wonderboymusic
Message:

Fix an error caused by [28604] in get_comments_number() unit tests.

Props SergeyBiryukov.
Fixes #26240.

File:
1 edited

Legend:

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

    r28604 r28638  
    685685        $post = get_post( $post_id );
    686686
    687         if ( ! isset( $post->comment_count ) ) {
     687        if ( ! $post ) {
    688688                $count = 0;
    689689        } else {
    690690                $count = $post->comment_count;
     691                $post_id = $post->ID;
    691692        }
    692693
     
    699700         * @param int $post_id Post ID.
    700701         */
    701         return apply_filters( 'get_comments_number', $count, $post->ID );
     702        return apply_filters( 'get_comments_number', $count, $post_id );
    702703}
    703704
Note: See TracChangeset for help on using the changeset viewer.