J82
J82

Reputation: 8457

Can I insert php into parameters?

Sorry if I worded the question wrong. In the code below, is there a way to insert php where the date is?

So this:

<?php echo do_shortcode('[fergcorp_cdt_single date="08 December 2013"]') ?>

Would become something like this:

<?php echo do_shortcode('[fergcorp_cdt_single date="<?=$date?>"]') ?>

Is the above correct? If not, how would I write it?

Upvotes: 0

Views: 116

Answers (2)

xdazz
xdazz

Reputation: 160853

You could also use double quotes:

<?php echo do_shortcode("[fergcorp_cdt_single date=\"$date\"]") ?>

Upvotes: 1

billyonecan
billyonecan

Reputation: 20260

<?php echo do_shortcode('[fergcorp_cdt_single date="' . $date . '"]'); ?>

Upvotes: 2

Related Questions