WC_Product_Query::get_products()publicWC 1.0

Get products matching the current query vars.

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

Возвращает

Массив|Объект. of WC_Product objects

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

$WC_Product_Query = new WC_Product_Query();
$WC_Product_Query->get_products();

Код WC_Product_Query::get_products() WC 7.1.0

public function get_products() {
	$args    = apply_filters( 'woocommerce_product_object_query_args', $this->get_query_vars() );
	$results = WC_Data_Store::load( 'product' )->query( $args );
	return apply_filters( 'woocommerce_product_object_query', $results, $args );
}