Passing a nested shortcode as an argument of another shortcode?

I’m curious how to process shortcodes in arguments (not nested shortcodes, which are already contemplated)::

function do_foo_shortcode($atts, $content = null) {
extract(shortcode_atts(array(
‘bar’ => ”,
), $atts, ‘foo’));

$bar = do_shortcode($bar);
$content = do_shortcode($content);

return “$bar – $content”;
}
add_shortcode(‘foo’, ‘do_foo_shortcode’);

For example in:

[foo bar=

]Hello world![/foo]

generates:

Hello world!

How can I consider such cases and how to correctly use them?

Read more here:: Passing a nested shortcode as an argument of another shortcode?

Leave a Reply

Your email address will not be published. Required fields are marked *