Automattic\WooCommerce\Internal\Admin\Reports

ProductSearchQuery::get_collection_param │ public static │ WC 11.2.0

Returns the REST collection parameter definition for the product search.

Метод класса: ProductSearchQuery{}

Хуков нет.

Возвращает

array. Parameter definition.

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

$result = ProductSearchQuery::get_collection_param();

Список изменений

С версии 11.2.0 Введена.

Код ProductSearchQuery::get_collection_param() WC 11.2.2

public static function get_collection_param() {
	return array(
		'description'       => __( 'Limit result to products whose name or SKU matches any of the given terms.', 'woocommerce' ),
		'type'              => 'array',
		'sanitize_callback' => array( self::class, 'parse_terms' ),
		'validate_callback' => 'rest_validate_request_arg',
		'items'             => array(
			'type' => 'string',
		),
	);
}