WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\StoreApi\Routes

ProductCollectionData::get_collection_params() public WC 1.0

Get the query params for collections of products.

{} Это метод класса: ProductCollectionData{}

Хуков нет.

Возвращает

Массив.

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

$ProductCollectionData = new ProductCollectionData();
$ProductCollectionData->get_collection_params();

Код ProductCollectionData::get_collection_params() WC 4.7.1

<?php
public function get_collection_params() {
	$params = ( new Products( $this->schema ) )->get_collection_params();

	$params['calculate_price_range'] = [
		'description' => __( 'If true, calculates the minimum and maximum product prices for the collection.', 'woocommerce' ),
		'type'        => 'boolean',
		'default'     => false,
	];

	$params['calculate_attribute_counts'] = [
		'description' => __( 'If requested, calculates attribute term counts for products in the collection.', 'woocommerce' ),
		'type'        => 'array',
		'items'       => [
			'type'       => 'object',
			'properties' => [
				'taxonomy'   => [
					'description' => __( 'Taxonomy name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
				'query_type' => [
					'description' => __( 'Query type being performed which may affect counts. Valid values include "and" and "or".', 'woocommerce' ),
					'type'        => 'string',
					'enum'        => [ 'and', 'or' ],
					'context'     => [ 'view', 'edit' ],
					'readonly'    => true,
				],
			],
		],
		'default'     => [],
	];

	$params['calculate_rating_counts'] = [
		'description' => __( 'If true, calculates rating counts for products in the collection.', 'woocommerce' ),
		'type'        => 'boolean',
		'default'     => false,
	];

	return $params;
}