Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\Account\Schema
AccountSettingsSchema::normalize_field_type
Normalize WooCommerce field types to REST API field types.
Метод класса: AccountSettingsSchema{}
Хуков нет.
Возвращает
string. Normalized field type.
Использование
// private - только в коде основоного (родительского) класса $result = $this->normalize_field_type( $wc_type ): string;
- $wc_type(строка) (обязательный)
- WooCommerce field type.
Код AccountSettingsSchema::normalize_field_type() AccountSettingsSchema::normalize field type WC 11.2.2
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;
}