“Enclosing” MFB shortcodes don’t seem to work

[ad_1]

Hi,

First thank you for this amazing plugin, it is a life saver when switching to full block theme on a dynamic site 😉

I have an issue with enclosing shortcodes, which don’t seem to be rendered correctly with MFB, but I might be missing something.

I reduced my test to this post content:

WP shortcode block [testmfb]
WP paragraph block "Test WP shortcode"
WP shortcode block [/testmfb]

MFB dynamic block [testmfb]
WP paragraph block "Test MFB shortcode"
MFB dynamic block [/testmfb]

With the following testmfb shortcode definition:

add_shortcode( 'testmfb', function( $atts = [], $content = null, $tag = '' ) {
	return '<div style="background-color: red">' . $content . '</div>';
} );

Result is this:

So it seems that MFB doesn’t render the enclosing shortcodes.

When inspecting the code, I can see the two MFB divs rendered with no value, so it looks like the enclosing shortcode is considered as two different shortcodes: [testmfb] and [/tesmfb].

Note: When I use only one MFB block with enclosing shortcodes in value parameter, it is working:

MFB dynamic block [testmfb]Test[/testmfb]

Hope it makes sense,
Yan

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer