WC_Comments::exclude_action_log_commentspublic staticWC 9.9

Exclude action_log comments from queries.

Method of the class: WC_Comments{}

No Hooks.

Returns

Array.

Usage

$result = WC_Comments::exclude_action_log_comments( $clauses, $comment_query );
$clauses(array) (required)
A compacted array of comment query clauses.
$comment_query(WP_Comment_Query) (required)
The WP_Comment_Query being filtered.

Changelog

Since 9.9 Introduced.

WC_Comments::exclude_action_log_comments() code WC 10.9.4

public static function exclude_action_log_comments( $clauses, $comment_query ) {
	if ( 'action_log' !== $comment_query->query_vars['type'] ) {
		$clauses['where'] .= ( trim( $clauses['where'] ) ? ' AND ' : '' ) . " comment_type != 'action_log' ";
	}

	return $clauses;
}