Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\Email\Schema
EmailSettingsSchema::map_setting_type_to_api_type
Map WooCommerce setting type to REST API type.
Метод класса: EmailSettingsSchema{}
Хуков нет.
Возвращает
string. REST API type.
Использование
// private - только в коде основоного (родительского) класса $result = $this->map_setting_type_to_api_type( $setting_type ): string;
- $setting_type(строка) (обязательный)
- WooCommerce setting type.
Код EmailSettingsSchema::map_setting_type_to_api_type() EmailSettingsSchema::map setting type to api type WC 11.2.2
private function map_setting_type_to_api_type( string $setting_type ): string {
$type_map = array(
'text' => 'text',
'email' => 'email',
'checkbox' => 'checkbox',
'number' => 'number',
'color' => 'color',
'select' => 'select',
);
return $type_map[ $setting_type ] ?? 'text';
}