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

WC_REST_Products_V2_Controller::get_collection_params() public WC 1.0

Get the query params for collections of attachments.

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

Хуков нет.

Возвращает

Массив.

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

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

Код WC_REST_Products_V2_Controller::get_collection_params() WC 4.7.1

<?php
public function get_collection_params() {
	$params = parent::get_collection_params();

	$params['orderby']['enum'] = array_merge( $params['orderby']['enum'], array( 'menu_order' ) );

	$params['slug']           = array(
		'description'       => __( 'Limit result set to products with a specific slug.', 'woocommerce' ),
		'type'              => 'string',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['status']         = array(
		'default'           => 'any',
		'description'       => __( 'Limit result set to products assigned a specific status.', 'woocommerce' ),
		'type'              => 'string',
		'enum'              => array_merge( array( 'any', 'future', 'trash' ), array_keys( get_post_statuses() ) ),
		'sanitize_callback' => 'sanitize_key',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['type']           = array(
		'description'       => __( 'Limit result set to products assigned a specific type.', 'woocommerce' ),
		'type'              => 'string',
		'enum'              => array_keys( wc_get_product_types() ),
		'sanitize_callback' => 'sanitize_key',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['sku']            = array(
		'description'       => __( 'Limit result set to products with specific SKU(s). Use commas to separate.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'sanitize_text_field',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['featured']       = array(
		'description'       => __( 'Limit result set to featured products.', 'woocommerce' ),
		'type'              => 'boolean',
		'sanitize_callback' => 'wc_string_to_bool',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['category']       = array(
		'description'       => __( 'Limit result set to products assigned a specific category ID.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'wp_parse_id_list',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['tag']            = array(
		'description'       => __( 'Limit result set to products assigned a specific tag ID.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'wp_parse_id_list',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['shipping_class'] = array(
		'description'       => __( 'Limit result set to products assigned a specific shipping class ID.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'wp_parse_id_list',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['attribute']      = array(
		'description'       => __( 'Limit result set to products with a specific attribute. Use the taxonomy name/attribute slug.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'sanitize_text_field',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['attribute_term'] = array(
		'description'       => __( 'Limit result set to products with a specific attribute term ID (required an assigned attribute).', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'wp_parse_id_list',
		'validate_callback' => 'rest_validate_request_arg',
	);

	if ( wc_tax_enabled() ) {
		$params['tax_class'] = array(
			'description'       => __( 'Limit result set to products with a specific tax class.', 'woocommerce' ),
			'type'              => 'string',
			'enum'              => array_merge( array( 'standard' ), WC_Tax::get_tax_class_slugs() ),
			'sanitize_callback' => 'sanitize_text_field',
			'validate_callback' => 'rest_validate_request_arg',
		);
	}

	$params['in_stock']  = array(
		'description'       => __( 'Limit result set to products in stock or out of stock.', 'woocommerce' ),
		'type'              => 'boolean',
		'sanitize_callback' => 'wc_string_to_bool',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['on_sale']   = array(
		'description'       => __( 'Limit result set to products on sale.', 'woocommerce' ),
		'type'              => 'boolean',
		'sanitize_callback' => 'wc_string_to_bool',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['min_price'] = array(
		'description'       => __( 'Limit result set to products based on a minimum price.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'sanitize_text_field',
		'validate_callback' => 'rest_validate_request_arg',
	);
	$params['max_price'] = array(
		'description'       => __( 'Limit result set to products based on a maximum price.', 'woocommerce' ),
		'type'              => 'string',
		'sanitize_callback' => 'sanitize_text_field',
		'validate_callback' => 'rest_validate_request_arg',
	);

	return $params;
}