Make WordPress Core


Ignore:
Timestamp:
05/04/2011 06:46:03 PM (14 years ago)
Author:
ryan
Message:

Fix notice thrown in wp_count_comments(). Props tfnab, batmoo. fixes #15215

File:
1 edited

Legend:

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

    r17667 r17795  
    905905    $total = 0;
    906906    $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed');
    907     $known_types = array_keys( $approved );
    908907    foreach ( (array) $count as $row ) {
    909908        // Don't count post-trashed toward totals
    910909        if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] )
    911910            $total += $row['num_comments'];
    912         if ( in_array( $row['comment_approved'], $known_types ) )
     911        if ( isset( $approved[$row['comment_approved']] ) )
    913912            $stats[$approved[$row['comment_approved']]] = $row['num_comments'];
    914913    }
Note: See TracChangeset for help on using the changeset viewer.