I have a code
$code = get_field('x_download');
where $code will get a number value say 192
now when i do
echo do_shortcode('email-download download_id="$code" contact_form_id="2"]');
i’m unable to get value of $code i.e 192 in download_id
I’m sure something is wrong with my syntax
Replace your line with this:
Single quotes will not replace your PHP variable with value, instead it prints the variable as it is. Double quotes will do the replacement.
You can do it as shown below