Automattic\WooCommerce\StoreApi\Routes\V1
ProductReviews::normalize_query_param
Prepends internal property prefix to query parameters to match our response fields.
Method of the class: ProductReviews{}
No Hooks.
Returns
string.
Usage
// protected - for code of main (parent) or child class $result = $this->normalize_query_param( $query_param );
- $query_param(string) (required)
- Query parameter.
ProductReviews::normalize_query_param() ProductReviews::normalize query param code WC 11.3.0
protected function normalize_query_param( $query_param ) {
$prefix = 'comment_';
switch ( $query_param ) {
case 'id':
$normalized = $prefix . 'ID';
break;
case 'product':
$normalized = $prefix . 'post_ID';
break;
case 'rating':
$normalized = 'meta_value_num';
break;
default:
$normalized = $prefix . $query_param;
break;
}
return $normalized;
}