ActionScheduler_wpCommentLogger::filter_comment_count()publicWC 1.0

Remove action log entries from wp_count_comments()

Метод класса: ActionScheduler_wpCommentLogger{}

Хуков нет.

Возвращает

Объект.

Использование

$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger();
$ActionScheduler_wpCommentLogger->filter_comment_count( $stats, $post_id );
$stats(массив) (обязательный)
-
$post_id(int) (обязательный)
-

Код ActionScheduler_wpCommentLogger::filter_comment_count() WC 8.7.0

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

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

	return $stats;
}