wp_count_comments

wp_count_comments

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('wp_count_comments') is found 1 times:

  • /wp-includes/comment.php line 1431
    	 *
    	 * @param array|stdClass $count   An empty array or an object containing comment counts.
    	 * @param int            $post_id The post ID. Can be 0 to represent the whole site.
    	 */
    	$filtered = apply_filters( 'wp_count_comments', array(), $post_id );
    	if ( ! empty( $filtered ) ) {
    		return $filtered;
    	}
    
    	$count = wp_cache_get( "comments-{$post_id}", 'counts' );
    	if ( false !== $count ) {
    

See this hook used in plugins: