ActionScheduler_wpCommentLogger::filter_comment_countpublicWC 1.0

Remove action log entries from wp_count_comments()

Method of the class: ActionScheduler_wpCommentLogger{}

No Hooks.

Returns

Object.

Usage

$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger();
$ActionScheduler_wpCommentLogger->filter_comment_count( $stats, $post_id );
$stats(array) (required)
Comment count.
$post_id(int) (required)
Post ID.

ActionScheduler_wpCommentLogger::filter_comment_count() code WC 10.8.1

public function filter_comment_count( $stats, $post_id ) {
	global $wpdb;

	if ( 0 === $post_id ) {
		$stats = $this->get_comment_count();
	}

	return $stats;
}