Register Custom Font Sizes
Add the following code to your theme’s functions.php file or a custom functionality plugin:
function cs_font_sizes() {
add_theme_support(
'editor-font-sizes',
array(
array(
'name' => __( 'Small', 'mytheme' ),
'shortName' => __( 'S', 'mytheme' ),
'size' => 14,
'slug' => 'small',
),
array(
'name' => __( 'Medium', 'mytheme' ),
'shortName' => __( 'M', 'mytheme' ),
'size' => 18,
'slug' => 'medium',
),
array(
'name' => __( 'Large', 'mytheme' ),
'shortName' => __( 'L', 'mytheme' ),
'size' => 32,
'slug' => 'large',
),
array(
'name' => __( 'Extra Large', 'mytheme' ),
'shortName' => __( 'XL', 'mytheme' ),
'size' => 48,
'slug' => 'x-large',
),
)
);
}
add_action( 'after_setup_theme', 'cs_font_sizes' );