wordpress - Using PHP inside a shortcode inside PHP... syntax issue -
ok, i'm ok php not expert. what's correct syntax here?
i'm trying pull in advanced custom field data inside php, inside shortcode.
i have acf field called: the_sub_field("google_doc_key")
<div><?php echo do_shortcode("[gdoc key='https://docs.google.com/spreadsheets/d/"'. the_sub_field("google_doc_key") .'"/edit' gid='0']"); ?></div>
somethings not right here... appreciated.
<div><?php echo do_shortcode("[gdoc key='https://docs.google.com/spreadsheets/d/'". the_sub_field("google_doc_key") ."'/edit' gid='0']"); ?></div>
try that, had ' , " mixed before the_sub_field
Comments
Post a Comment