Automattic\WooCommerce\EmailEditor\Engine
Theme_Controller::translate_slug_to_font_size
Translate font family slug to font family name.
Method of the class: Theme_Controller{}
No Hooks.
Returns
String.
Usage
$Theme_Controller = new Theme_Controller(); $Theme_Controller->translate_slug_to_font_size( $font_size ): string;
- $font_size(string) (required)
- Font size slug.
Theme_Controller::translate_slug_to_font_size() Theme Controller::translate slug to font size code WC 10.5.0
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;
}