我已经想出了一个解决办法。do\\u shortcode将处理包装中的所有shortcode内容,但是我希望在不同的位置处理嵌套的shotcode。
<?php
// make sure only the [chord] shortcodes are inserted here.
$custom_chords = rtrim($custom_chords, "]");
$custom_chords_array = explode(\']\', strip_tags($custom_chords));
foreach($custom_chords_array as $custom_chord){
if(strpos($custom_chord, \'[chord\') != false){
echo do_shortcode($custom_chord .\']\');
}
}
?>
似乎有用!