Quantcast
Channel: Disable Gutenberg text-Settings in all blocks - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 5

Answer by jg314 for Disable Gutenberg text-Settings in all blocks

$
0
0

As Jim Rhoades noted in one of the comments, you can declare support for custom font sizes, but leave out the array of font size options. This removes the "Typography" section entirely so there is no way to choose a font size. The code looks like this:

add_theme_support( 'editor-font-sizes' );

For those looking for all the code needed to make it work, you would call this from the after_setup_theme hook inside the functions.php file within your theme:

function theme_setup() {    add_theme_support( 'editor-font-sizes' );}add_action( 'after_setup_theme', 'theme_setup' );

I've tested this in WordPress 5.7, but it's possible it's supported before this version.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>