WC_Brands::rest_api_product_collection_params
Documents additional query params for collections of products.
Method of the class: WC_Brands{}
No Hooks.
Returns
Array. JSON Schema-formatted collection parameters.
Usage
$WC_Brands = new WC_Brands(); $WC_Brands->rest_api_product_collection_params( $params, $post_type );
- $params(array) (required)
- JSON Schema-formatted collection parameters.
- $post_type(WP_Post_Type) (required)
- Post type object.
WC_Brands::rest_api_product_collection_params() WC Brands::rest api product collection params code WC 10.4.3
public function rest_api_product_collection_params( $params, $post_type ) {
$params['brand'] = array(
'description' => __( 'Limit result set to products assigned a specific brand ID.', 'woocommerce' ),
'type' => 'string',
'sanitize_callback' => 'wp_parse_id_list',
'validate_callback' => 'rest_validate_request_arg',
);
return $params;
}