render block – nested shortcodes
-
I show in my documentation how to use the plugins shortcodes. I work with the default block editor and I get annoyed every time the block is rendered incorrectly, because I forgot to write it in
[prismatic_code][/prismatic_code]
tags. So I wrote a function that prevents this. Maybe you could include it in the plugin or put it in the FAQ.add_filter( 'render_block', function ( $block_content, $block ) { if ( $block['blockName'] === 'prismatic/blocks' ) { if (strpos($block['innerHTML'], 'prismatic_code') === false) { return str_replace("[","[",$block['innerHTML']); } } return $block_content; }, 10, 2 );
Edit: The replaced character should be
& # 0 9 1 ;
without spaces.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘render block – nested shortcodes’ is closed to new replies.