WC_Query::get_main_query()public staticWC 1.0

Get the main query which product queries ran against.

Method of the class: WC_Query{}

No Hooks.

Return

WP_Query.

Usage

$result = WC_Query::get_main_query();

WC_Query::get_main_query() code WC 8.7.0

public static function get_main_query() {
	return self::$product_query;
}