Is it possible to use variables from shortcode_atts
in another function? Here is my idea:
Posting
[gallery ids="1,2,3,...n"]
Function get_gallery_ids()
//get the gallery-ID's from post
function get_gallery_ids($atts) {
extract(shortcode_atts(array(
'ids' => ''
), $atts));
return $ids;
}
Function explode_ids()
//example function with ids
function explode_ids($ids) {
$ids = explode(',' $ids);
}
How do I implement it? The return just echos.
Update
The code above is a part of my own new gallery_shortcode.
remove_shortcode('gallery', 'gallery_shortcode');
add_shortcode('gallery', 'get_gallery_ids');
" ... return $output; Is there no better way? – kenwebart Sep 20 '13 at 15:35