WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_products() protected WC 1.0

Run the query and return an array of product IDs

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

Return

Array. List of product IDs

Usage

// protected - for code of main (parent) or child class
$result = $this->get_products();

Code of AbstractProductGrid::get_products() WC 5.9.0

protected function get_products() {
	$is_cacheable      = (bool) apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', true, $this->query_args );
	$transient_version = \WC_Cache_Helper::get_transient_version( 'product_query' );

	$query   = new BlocksWpQuery( $this->query_args );
	$results = wp_parse_id_list( $is_cacheable ? $query->get_cached_posts( $transient_version ) : $query->get_posts() );

	// Remove ordering query arguments which may have been added by get_catalog_ordering_args.
	WC()->query->remove_ordering_args();

	// Prime caches to reduce future queries.
	if ( is_callable( '_prime_post_caches' ) ) {
		_prime_post_caches( $results );
	}

	return $results;
}