Make WordPress Core


Ignore:
Timestamp:
12/22/2004 02:36:26 PM (21 years ago)
Author:
michelvaldrighi
Message:

typo id -> comment_id made WP make one extra query per post

File:
1 edited

Legend:

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

    r1970 r1992  
    3737    global $wpdb, $comment_count_cache;
    3838    $comment_id = (int) $comment_id;
    39     if ('' == $comment_count_cache["$id"])
     39    if (!isset($comment_count_cache[$comment_id]))
    4040        $number =  $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$comment_id' AND comment_approved = '1'");
    4141    else
    42         $number =  $comment_count_cache["$id"];
     42        $number =  $comment_count_cache[$comment_id];
    4343    return apply_filters('get_comments_number', $number);
    4444}
Note: See TracChangeset for help on using the changeset viewer.