WordPress at Your Fingertips
function is not described

WC_REST_Product_Reviews_Controller::normalize_query_param() protected WC 3.5.0

Prepends internal property prefix to query parameters to match our response fields.

{} It's a method of the class: WC_REST_Product_Reviews_Controller{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->normalize_query_param( $query_param );
$query_param(string) (required)
Query parameter.

Changelog

Since 3.5.0 Introduced.

Code of WC_REST_Product_Reviews_Controller::normalize_query_param() WC 5.6.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 'include':
			$normalized = 'comment__in';
			break;
		default:
			$normalized = $prefix . $query_param;
			break;
	}

	return $normalized;
}