Skip to content

Instantly share code, notes, and snippets.

@addisonhall
Created February 20, 2026 21:45
Show Gist options
  • Select an option

  • Save addisonhall/321ce905eea935191c44551d50fbc284 to your computer and use it in GitHub Desktop.

Select an option

Save addisonhall/321ce905eea935191c44551d50fbc284 to your computer and use it in GitHub Desktop.
Add tag name options to GenerateBlocks container block
<?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