ActionScheduler_wpCommentLogger::filter_comment_queries()publicWC 1.0

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

Хуков нет.

Возвращает

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

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

$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger();
$ActionScheduler_wpCommentLogger->filter_comment_queries( $query );
$query(WP_Comment_Query) (обязательный)
-

Код ActionScheduler_wpCommentLogger::filter_comment_queries() WC 8.7.0

public function filter_comment_queries( $query ) {
	foreach ( array('ID', 'parent', 'post_author', 'post_name', 'post_parent', 'type', 'post_type', 'post_id', 'post_ID') as $key ) {
		if ( !empty($query->query_vars[$key]) ) {
			return; // don't slow down queries that wouldn't include action_log comments anyway
		}
	}
	$query->query_vars['action_log_filter'] = TRUE;
	add_filter( 'comments_clauses', array( $this, 'filter_comment_query_clauses' ), 10, 2 );
}