Is it possible to run a loop inside the do_shortcode() function?
Example:
echo do_shortcode('[iscorrect]'.$text_to_be_wrapped_in_shortcode.'[/iscorrect]');
http://codex.wordpress.org/Function_Reference/do_shortcode
I have tried creating a function to obtain the data and stick it in an array. Then for each item in that array, return the individual array value.
Example:
function the_ips(){
$ips = get_ips();
foreach($ips as $ip){
return $ip;
}
}
I have dumped the array of data to be sure it has the correct data within it. Everything is correct. It continues to output the first value of the array within the do_shortcode() function, but nothing else.
Here is what I have tried:
echo do_shortcode('[iscorrect]'.the_ips().'[/iscorrect]');
or
$content = '';
$content .= '[iscorrect]';
$ips = get_ips();
foreach($ips as $ip){
$content .= $ip;
}
$content .= '[/iscorrect]';
echo do_shortcode($content);
It still continues to produce the first result of the array and nothing else.