Make WordPress Core


Ignore:
Timestamp:
04/20/2022 05:51:21 AM (3 years ago)
Author:
peterwilsoncc
Message:

Comments: Improve accuracy of get_comment_count() docblock.

Remove reference to uncached database query now get_comment_count() uses WP_Comment_Query which contains caching. Remove reference to $wpdb global, it is no longer used.

Follow up to [53036].

Fixes #19901.

File:
1 edited

Legend:

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

    r53036 r53225  
    359359 * Retrieves the total comment counts for the whole site or a single post.
    360360 *
    361  * Unlike wp_count_comments(), this function always returns the live comment counts without caching.
    362  *
    363361 * @since 2.0.0
    364  *
    365  * @global wpdb $wpdb WordPress database abstraction object.
    366362 *
    367363 * @param int $post_id Optional. Restrict the comment counts to the given post. Default 0, which indicates that
     
    380376 */
    381377function get_comment_count( $post_id = 0 ) {
    382     global $wpdb;
    383 
    384378    $post_id = (int) $post_id;
    385379
Note: See TracChangeset for help on using the changeset viewer.