Automattic\WooCommerce\EmailEditor\Engine
Theme_Controller::translate_slug_to_font_size
Translate font family slug to font family name.
Метод класса: Theme_Controller{}
Хуков нет.
Возвращает
Строку.
Использование
$Theme_Controller = new Theme_Controller(); $Theme_Controller->translate_slug_to_font_size( $font_size ): string;
- $font_size(строка) (обязательный)
- Font size slug.
Код Theme_Controller::translate_slug_to_font_size() Theme Controller::translate slug to font size WC 10.9.1
public function translate_slug_to_font_size( string $font_size ): string {
$settings = $this->get_settings();
foreach ( $settings['typography']['fontSizes']['default'] as $font_size_definition ) {
if ( $font_size_definition['slug'] === $font_size ) {
return $font_size_definition['size'];
}
}
return $font_size;
}