Replace font size slugs with values in typography preprocessor
[MAILPOET-5740]
This commit is contained in:
committed by
Jan Lysý
parent
d62f3c1938
commit
a472df257a
@@ -199,4 +199,15 @@ class SettingsController {
|
||||
}
|
||||
return $css;
|
||||
}
|
||||
|
||||
public function translateSlugToFontSize(string $fontSize): string {
|
||||
$coreTheme = \WP_Theme_JSON_Resolver::get_core_data();
|
||||
$coreSettings = $coreTheme->get_settings();
|
||||
foreach ($coreSettings['typography']['fontSizes']['default'] as $fontSizeDefinition) {
|
||||
if ($fontSizeDefinition['slug'] === $fontSize) {
|
||||
return $fontSizeDefinition['size'];
|
||||
}
|
||||
}
|
||||
return $fontSize;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user