WC_REST_General_Settings_V4_Controller::normalize_field_typeprivateWC 1.0

Normalize WooCommerce field types to REST API field types.

Method of the class: WC_REST_General_Settings_V4_Controller{}

No Hooks.

Returns

String. Normalized field type.

Usage

// private - for code of main (parent) class only
$result = $this->normalize_field_type( $wc_type );
$wc_type(string) (required)
WooCommerce field type.

WC_REST_General_Settings_V4_Controller::normalize_field_type() code WC 10.3.6

private function normalize_field_type( $wc_type ) {
	$type_map = array(
		'single_select_country'  => 'select',
		'multi_select_countries' => 'multiselect',
	);

	return $type_map[ $wc_type ] ?? $wc_type;
}