Tribe__Events__Aggregator__Errors::hide_error_comments_pre_41( array $clauses, obj $wp_comment_query )

Exclude Aggregator Errors (comments) from showing in Recent Comments widgets Note: On Pre WP 4.1


Parameters

$clauses

(array) (Required) Comment clauses for comment query

$wp_comment_query

(obj) (Required) WordPress Comment Query Object


Top ↑

Return

(array) $clauses Updated comment clauses


Top ↑

Source

File: src/Tribe/Aggregator/Errors.php

	public function hide_error_comments_pre_41( $clauses, $wp_comment_query ) {
		global $wpdb, $wp_version;

		// Prevent this happening if we don't have EA active
		if ( ! tribe( 'events-aggregator.main' )->is_active( true ) ) {
			return $clauses;
		}

		if( version_compare( floatval( $wp_version ), '4.1', '<' ) ) {
			$clauses['where'] .= $wpdb->prepare( ' AND comment_type != %s', self::$comment_type );
		}
		return $clauses;
	}

Top ↑

Changelog

Changelog
Version Description
4.3.2 Introduced.