Automattic\WooCommerce\Blocks\BlockTypes
AbstractProductGrid::get_products() protected WC 1.0
Run the query and return an array of product IDs
{} Это метод класса: AbstractProductGrid{}
Хуки из метода
Возвращает
Массив
. List of product IDs
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_products();
Код AbstractProductGrid::get_products() AbstractProductGrid::get products WC 5.2.2
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;
}