WC_Brands::rest_api_product_collection_params()
Documents additional query params for collections of products.
Метод класса: WC_Brands{}
Хуков нет.
Возвращает
Массив
. JSON Schema-formatted collection parameters.
Использование
$WC_Brands = new WC_Brands(); $WC_Brands->rest_api_product_collection_params( $params, $post_type );
- $params(массив) (обязательный)
- JSON Schema-formatted collection parameters.
- $post_type(WP_Post_Type) (обязательный)
- Post type object.
Код WC_Brands::rest_api_product_collection_params() WC Brands::rest api product collection params WC 9.4.2
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; }