Theme developers can disable the custom font size option, which allows the publisher to set any font size in paragraphs and other blocks.
- [Instructor] Speaking of the font sizes,…out of the box, a user can go into any paragraph block…and use the toggle here on the right hand side…to set any font size they want.…Now there's a good chance as a theme developer…you may want to disable this option,…because you only want the user to be able…to use specific predefined font sizes…that look good and work properly within the theme.…If so, you can disable this custom feature here.…That's done with a single line of code.…I'll add it directly before custom font sizes.…I'll say Disable custom font sizing.…
And then we say add_theme_support('disable-custom-sizes');…and just like with the colors…this is a bit of a deceptive name,…because it sounds like you're disabling…custom font sizes all together.…What you're actually doing is disabling the toggle…that allows the user to customize…the font size to whatever they want.…So once you've added that feature,…what's left for the user is to use the dropdown here…with the font sizes you've specified.…
Released
1/22/2019- Declaring support for default block styles
- Adding support and styles for wide alignment
- Supporting theme-specific colors and fonts
- Extending block styles
- Adding new style variations
Share this video
Embed this video
Video: Disable custom font sizes