Nested shortcode not working correctly
-
Are nested shortcodes supported? I read your comment from an old thread where you said “In version 5.0+ the shortcode content can have another “shortcoder shortcode” there is no restriction.” but in my case there’s a bug where the 2nd shortcoder closing tag is printed on the web page.
I’ve created 2 shortcodes. Shortcode 1 is called “sc-test-nest-1” and contains “SC1 content and $$enclosed_content$$”. Shortcode 2 is called “sc-test-nest-2” and contains “SC2 content”.
In a blank page I’ve inserted this shortcode “[sc name=”sc-test-nest-1″][sc name=”sc-test-nest-2″][/sc][/sc]”.
The result should be “SC1 content and SC2 content”, but it is producing “SC1 content and SC2 content[/sc]”.
Can you please advise on whether nested shortcodes should be working, and how I can fix this?
- The topic ‘Nested shortcode not working correctly’ is closed to new replies.