I am trying to create a shortcode with an array as input like so
function product_gallery_shortcode($atts) {
extract(shortcode_atts(array(
'product_id' => '31',
'prodvid' => false,
'youtubeids'=>'',//['lbRqMddP2jo','eFAxx817rC0'],
'thumbnr' =>2
), $atts));
I like to loop throught the youtube id’s but i don’t know how to initialize the youtubeids as an array
so it reads
'youtubeids'=> array('lbRrePOP2jo','eFAxx17rC0'),
regards
Ok found a solution
and i had to turn youtubeids into an array again
I found the best solution for this problem. If you want use array for input of shortcode use this:
In your shortcode input you can use the following for each array index:
Simple way I use:
in shortcode callback, just do:
Could you not just do: