Function that returns data in an array – Wp All Export –
-
This is an automatic translation
Good day,
I’m trying to return, with a personal function, an array of data. But in the xml file they are not decoded and show:
<Image> Array </ image>
<Image> Array </ image>
……FUNCTION
function cr_get_images($id) { $gallery_list = get_post_meta($id, '_gallery', true ); $array_data = array(); foreach ($gallery_list as $key =>$value) : $array_data[] = array('image'=>$value, 'alttext'=>$key); endforeach; return $array_data; }
CALL
<image>[cr_get_images({ID})]</image>
I tried to pass serialized data with:
return serialize($array_data);
but in the xml file they are not deserializedHow can I pass an associative array of data like this to a custom XML file, using the Wp All Export editor?
$array_data[] = array('image'=>$value, 'alttext'=>$key);
Thanks, Claudio_
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Function that returns data in an array – Wp All Export –’ is closed to new replies.