Skip to content

Instantly share code, notes, and snippets.

@ronalfy
Created January 7, 2026 19:00
Show Gist options
  • Select an option

  • Save ronalfy/4c5d4dfc0f2234614e76283eb48ce474 to your computer and use it in GitHub Desktop.

Select an option

Save ronalfy/4c5d4dfc0f2234614e76283eb48ce474 to your computer and use it in GitHub Desktop.
Simple TOC - Remove GB 2.0 Text Blocks
<?php
/**
* Removes GB 2.0 from Simple TOC.
*/
add_filter(
'simpletoc_supported_third_party_blocks',
function ( $supported_third_party_blocks ) {
// Find generateblocks/text and remove it.
$index = array_search( 'generateblocks/text', $supported_third_party_blocks, true );
if ( false !== $index ) {
unset( $supported_third_party_blocks[ $index ] );
}
return $supported_third_party_blocks;
},
);
add_filter(
'simpletoc_supported_blocks_for_ids',
function ( $supported_blocks_for_ids ) {
// Find generateblocks/text and remove it.
$index = array_search( 'generateblocks/text', $supported_blocks_for_ids, true );
if ( false !== $index ) {
unset( $supported_blocks_for_ids[ $index ] );
}
return $supported_blocks_for_ids;
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment