Created
August 19, 2021 09:21
-
-
Save odil-io/ce5afa679ee41bb5a16ef68f05e07cd1 to your computer and use it in GitHub Desktop.
Gutenberg: Add custom font sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function namespace_define_font_sizes() { | |
add_theme_support( | |
'editor-font-sizes', | |
[ | |
[ | |
'name' => __( 'Small', 'namespace' ), | |
'size' => 16, | |
'slug' => 'namespace-small', | |
], | |
[ | |
'name' => __( 'Regular', 'namespace' ), | |
'size' => 20, | |
'slug' => 'namespace-regular', | |
], | |
[ | |
'name' => __( 'Large', 'namespace' ), | |
'size' => 24, | |
'slug' => 'namespace-large', | |
], | |
] | |
); | |
} | |
add_action( 'after_setup_theme', 'namespace_define_font_sizes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment