File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,23 @@ function filter_headings_recursive($blocks)
313313 }
314314 }
315315
316- if (isset ($ blocks ['blockName ' ]) && ($ blocks ['blockName ' ] === 'generateblocks/headline ' ) && $ innerBlock !== 'core/heading ' ) {
316+ $ supported_third_party_blocks = array (
317+ 'generateblocks/headline ' , /* GenerateBlocks 1.x */
318+ 'generateblocks/text ' , /* GenerateBlocks 2.0 */
319+ );
320+
321+ /**
322+ * Filter to add supported third party blocks.
323+ *
324+ * @param array $supported_third_party_blocks The array of supported third party blocks.
325+ * @return array The modified array of supported third party blocks.
326+ */
327+ $ supported_third_party_blocks = apply_filters (
328+ 'simpletoc_supported_third_party_blocks ' ,
329+ $ supported_third_party_blocks
330+ );
331+
332+ if (isset ($ blocks ['blockName ' ]) && in_array ($ blocks ['blockName ' ], $ supported_third_party_blocks ) && $ innerBlock !== 'core/heading ' ) {
317333 // make sure it's a headline.
318334 if (preg_match ("/(<h1|<h2|<h3|<h4|<h5|<h6)/i " , $ innerBlock )) {
319335 $ arr [] = $ innerBlock ;
You can’t perform that action at this time.
0 commit comments