Last active
July 29, 2024 21:22
-
-
Save fribibb/bb995c3986b8a283159cd75e698304aa to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Filter heading block levels | |
* Gutenberg 19.0+, see https://github.com/WordPress/gutenberg/pull/63535. | |
*/ | |
function example_modify_heading_levels_globally( $args, $block_type ) { | |
if ( 'core/heading' !== $block_type ) { | |
return $args; | |
} | |
// Remove H1. | |
$args['attributes']['levelOptions']['default'] = [ 2, 3, 4, 5, 6 ]; | |
return $args; | |
} | |
add_filter( 'register_block_type_args', 'example_modify_heading_levels_globally', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment