Skip to content

Instantly share code, notes, and snippets.

@mahdiyazdani
Last active October 1, 2019 16:47
Show Gist options
  • Save mahdiyazdani/6d2fc78c6b874ccbf6225c358a3e56d1 to your computer and use it in GitHub Desktop.
Save mahdiyazdani/6d2fc78c6b874ccbf6225c358a3e56d1 to your computer and use it in GitHub Desktop.
Adding support for editor font sizes
<?php
function prefix_setup_theme() {
add_theme_support( 'editor-font-sizes', array(
array(
'name' => __( 'Small', 'themeLangDomain' ),
'size' => 12,
'slug' => 'small'
),
array(
'name' => __( 'Normal', 'themeLangDomain' ),
'size' => 16,
'slug' => 'normal'
),
array(
'name' => __( 'Large', 'themeLangDomain' ),
'size' => 36,
'slug' => 'large'
),
array(
'name' => __( 'Huge', 'themeLangDomain' ),
'size' => 50,
'slug' => 'huge'
)
) );
}
add_action( 'after_setup_theme', 'prefix_setup_theme', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment