-2

how do i put this <?php echo $cfs->get('exclude'); ?> within the double quotes in this <?php echo do_shortcode('[gallery exclude=""]'); ?>

meaning, what is the correct syntax to merge the two? i attempted to read through some of this to solve it, but have little php knowledge.

thank you.

4

3 回答 3

3
sprintf('[gallery exclude="%s"]', $cfs->get('exclude'));

sprintf()

也可读:

$exclude = $cfs->get('exclude');
"[gallery exclude=\"$exclude\"]";
于 2013-02-28T23:09:22.073 回答
0
<?php echo do_shortcode("[gallery exclude='$cfs->get('exclude')]'); ?>
于 2013-02-28T23:10:08.863 回答
0

这是一种方式

echo do_shortcode('[gallery exclude="' . $cfs->get('exclude') . '"]'); ?>
于 2013-02-28T23:08:28.197 回答