Created
January 7, 2026 19:00
-
-
Save ronalfy/4c5d4dfc0f2234614e76283eb48ce474 to your computer and use it in GitHub Desktop.
Simple TOC - Remove GB 2.0 Text Blocks
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 | |
| /** | |
| * 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