WordPress.org

Make WordPress Core

Changeset 10078


Ignore:
Timestamp:
12/05/2008 11:40:09 PM (12 years ago)
Author:
ryan
Message:

Allow plugins to hook in a custom comment counter

File:
1 edited

Legend:

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

    r10042 r10078  
    677677    $post_id = (int) $post_id;
    678678
     679    $stats = apply_filters('wp_count_comments', array(), $post_id);
     680    if ( !empty($stats) )
     681        return $stats;
     682
    679683    $count = wp_cache_get("comments-{$post_id}", 'counts');
    680684
     
    689693
    690694    $total = 0;
    691     $stats = array( );
    692695    $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');
    693696    foreach( (array) $count as $row_num => $row ) {
Note: See TracChangeset for help on using the changeset viewer.