Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\Account\Schema

AccountSettingsSchema::normalize_field_typeprivateWC 1.0

Normalize WooCommerce field types to REST API field types.

Method of the class: AccountSettingsSchema{}

No Hooks.

Returns

String. Normalized field type.

Usage

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

AccountSettingsSchema::normalize_field_type() code WC 10.4.3

private function normalize_field_type( string $wc_type ): string {
	$type_map = array(
		'single_select_page'             => 'select',
		'single_select_page_with_search' => 'select',
	);

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