WC_REST_Products_Catalog_Controller::sanitize_fields_argpublicWC 1.0

Sanitize fields argument.

Method of the class: WC_REST_Products_Catalog_Controller{}

No Hooks.

Returns

Array. Sanitized and canonicalized fields array.

Usage

$WC_REST_Products_Catalog_Controller = new WC_REST_Products_Catalog_Controller();
$WC_REST_Products_Catalog_Controller->sanitize_fields_arg( $value );
$value(mixed) (required)
The value to sanitize. Can be an array or comma-separated string.

WC_REST_Products_Catalog_Controller::sanitize_fields_arg() code WC 10.4.3

public function sanitize_fields_arg( $value ) {
	if ( is_string( $value ) ) {
		$value = array_map( 'trim', explode( ',', $value ) );
	}
	return $this->canonicalize_fields( is_array( $value ) ? $value : array() );
}