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

Automattic\WooCommerce\Blocks\StoreApi\Routes

ProductReviews::get_collection_params() public WC 1.0

Get the query params for collections of products.

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

Хуков нет.

Возвращает

Массив.

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

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

Код ProductReviews::get_collection_params() WC 4.7.1

<?php
public function get_collection_params() {
	$params                       = array();
	$params['context']            = $this->get_context_param();
	$params['context']['default'] = 'view';

	$params['page'] = array(
		'description'       => __( 'Current page of the collection.', 'woocommerce' ),
		'type'              => 'integer',
		'default'           => 1,
		'sanitize_callback' => 'absint',
		'validate_callback' => 'rest_validate_request_arg',
		'minimum'           => 1,
	);

	$params['per_page'] = array(
		'description'       => __( 'Maximum number of items to be returned in result set. Defaults to no limit if left blank.', 'woocommerce' ),
		'type'              => 'integer',
		'default'           => 10,
		'minimum'           => 0,
		'maximum'           => 100,
		'sanitize_callback' => 'absint',
		'validate_callback' => 'rest_validate_request_arg',
	);

	$params['offset'] = array(
		'description'       => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
		'type'              => 'integer',
		'sanitize_callback' => 'absint',
		'validate_callback' => 'rest_validate_request_arg',
	);

	$params['order'] = array(
		'description'       => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
		'type'              => 'string',
		'default'           => 'desc',
		'enum'              => array( 'asc', 'desc' ),
		'validate_callback' => 'rest_validate_request_arg',
	);

	$params['orderby'] = array(
		'description'       => __( 'Sort collection by object attribute.', 'woocommerce' ),
		'type'              => 'string',
		'default'           => 'date',
		'enum'              => array(
			'date',
			'date_gmt',
			'id',
			'rating',
			'product',
		),
		'validate_callback' => 'rest_validate_request_arg',
	);

	$params['category_id'] = array(
		'description'       => __( 'Limit result set to reviews from specific category IDs.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'wp_parse_id_list',
		'validate_callback' => 'rest_validate_request_arg',
	);

	$params['product_id'] = array(
		'description'       => __( 'Limit result set to reviews from specific product IDs.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'wp_parse_id_list',
		'validate_callback' => 'rest_validate_request_arg',
	);

	return $params;
}