diff --git a/plugin.php b/plugin.php index 3a2145e..22a90d3 100644 --- a/plugin.php +++ b/plugin.php @@ -313,7 +313,23 @@ function filter_headings_recursive($blocks) } } - if (isset($blocks['blockName']) && ($blocks['blockName'] === 'generateblocks/headline') && $innerBlock !== 'core/heading') { + $supported_third_party_blocks = array( + 'generateblocks/headline', /* GenerateBlocks 1.x */ + 'generateblocks/text', /* GenerateBlocks 2.0 */ + ); + + /** + * Filter to add supported third party blocks. + * + * @param array $supported_third_party_blocks The array of supported third party blocks. + * @return array The modified array of supported third party blocks. + */ + $supported_third_party_blocks = apply_filters( + 'simpletoc_supported_third_party_blocks', + $supported_third_party_blocks + ); + + if (isset($blocks['blockName']) && in_array($blocks['blockName'], $supported_third_party_blocks) && $innerBlock !== 'core/heading') { // make sure it's a headline. if (preg_match("/(