ActionScheduler_wpCommentLogger::init()publicWC 1.0

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger();
$ActionScheduler_wpCommentLogger->init();

Код ActionScheduler_wpCommentLogger::init() WC 8.7.0

public function init() {
	add_action( 'action_scheduler_before_process_queue', array( $this, 'disable_comment_counting' ), 10, 0 );
	add_action( 'action_scheduler_after_process_queue', array( $this, 'enable_comment_counting' ), 10, 0 );

	parent::init();

	add_action( 'pre_get_comments', array( $this, 'filter_comment_queries' ), 10, 1 );
	add_action( 'wp_count_comments', array( $this, 'filter_comment_count' ), 20, 2 ); // run after WC_Comments::wp_count_comments() to make sure we exclude order notes and action logs
	add_action( 'comment_feed_where', array( $this, 'filter_comment_feed' ), 10, 2 );

	// Delete comments count cache whenever there is a new comment or a comment status changes
	add_action( 'wp_insert_comment', array( $this, 'delete_comment_count_cache' ) );
	add_action( 'wp_set_comment_status', array( $this, 'delete_comment_count_cache' ) );
}