Shortcode in current version not working
-
Hi there,
thanks for the recent update – it looks great!
However, I noticed that shortcodes are currently not working properly in the new version.At the moment, only
core/shortcodeblocks are passed throughdo_shortcode(), but shortcodes inside other blocks (like paragraphs or columns) are no longer executed.Also, the final
$contentdoesn’t seem to be passed throughapply_filters( 'the_content', $content ), which is normally essential for processing shortcodes, oEmbeds, and other content filters.Would it be possible to adjust this in a future update?
Here’s a version that works well on our end:
$content = '';
foreach ( $blocks as $block ) {
if( 'core/embed' === $block['blockName'] ){
$content .= apply_filters( 'the_content', render_block( $block ) );
}else{
// $content .= render_block( $block );
$content .= do_shortcode(render_block( $block ));
}
}
$content = apply_filters('the_content', $content);
return wp_kses( $content, $allowedHTML );
}Thanks a lot for looking into it – and for your great work on this plugin!
The topic ‘Shortcode in current version not working’ is closed to new replies.