woocommerce_report_recent_reviews_query_from filter-hookWC 3.1.0

Filters the from-clause used for fetching latest product reviews.

Usage

add_filter( 'woocommerce_report_recent_reviews_query_from', 'wp_kama_woocommerce_report_recent_reviews_query_from_filter' );

/**
 * Function for `woocommerce_report_recent_reviews_query_from` filter-hook.
 * 
 * @param string $clause The from-clause.
 *
 * @return string
 */
function wp_kama_woocommerce_report_recent_reviews_query_from_filter( $clause ){

	// filter...
	return $clause;
}
$clause(string)
The from-clause.

Changelog

Since 3.1.0 Introduced.

Where the hook is called

WC_Admin_Dashboard::legacy_recent_reviews()
woocommerce_report_recent_reviews_query_from
woocommerce/includes/admin/class-wc-admin-dashboard.php 428-439
$query_from = apply_filters(
	'woocommerce_report_recent_reviews_query_from',
	"FROM {$wpdb->comments} comments
	LEFT JOIN {$wpdb->posts} posts ON (comments.comment_post_ID = posts.ID)
	WHERE comments.comment_approved = '1'
	AND comments.comment_type = 'review'
	AND posts.post_password = ''
	AND posts.post_type = 'product'
	AND comments.comment_parent = 0
	ORDER BY comments.comment_date_gmt DESC
	LIMIT 5"
);

Where the hook is used in WooCommerce

Usage not found.