Created
February 20, 2026 21:45
-
-
Save addisonhall/321ce905eea935191c44551d50fbc284 to your computer and use it in GitHub Desktop.
Add tag name options to GenerateBlocks container block
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 | |
| add_filter( 'block_type_metadata', function( $metadata ) { | |
| if ( isset( $metadata['name'] ) && $metadata['name'] === 'generateblocks/element' ) { | |
| $metadata['attributes']['tagName']['enum'] = array_merge( | |
| $metadata['attributes']['tagName']['enum'], | |
| // here's where we add our stuff | |
| ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] | |
| ); | |
| } | |
| return $metadata; | |
| }, 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment