WordPress at Your Fingertips
function is not described

WC_Product_Query::get_products() public WC 1.0

Get products matching the current query vars.

{} It's a method of the class: WC_Product_Query{}

Return

Array|Object. of WC_Product objects

Usage

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

Code of WC_Product_Query::get_products() WC 5.6.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 );
}