使用 do_shortcode 和另一个简码作为属性

Using do_shortcode with another shortcode as attributes

我正在尝试使用 do_shortcode 在模板中放置简码。我要执行的简码是这样的:

[image_with_animation image_url="3185" animation="Fade In" img_link_target="_self"]

我的挑战是属性“3185”需要来自另一个简码,即:

[field ImgPortFull]

我试过最明显的方法:

echo do_shortcode ( '[image_with_animation image_url="'.[field ImgPortFull].'" animation="Fade In" img_link_target="_self"]' );

以及其他各种方式,但我无法让它发挥作用。 有人有解决办法吗?

顺便说一句,如果有人想知道,我正在使用插件 "Visual Composer" 和 "Custom Content" 的组合。

您必须对每个短代码调用 do_shortcode。所以尝试:

echo do_shortcode ( '[image_with_animation image_url="'.do_shortcode ('[field ImgPortFull]').'" animation="Fade In" img_link_target="_self"]' );