From 76fa1e0fb9323d15206a92095c2808e284671ef7 Mon Sep 17 00:00:00 2001 From: Vasken Hauri <vhauri@gmail.com> Date: Fri, 19 Apr 2013 16:27:28 +0000 Subject: [PATCH] enable multiple values returned from an xpath query to be saved as an array of metadata with each element cast to a string rather than saving just the first element in the array as a string --- includes/class-syndication-wp-xml-client.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class-syndication-wp-xml-client.php b/includes/class-syndication-wp-xml-client.php index 7e5cdaf..4766d4f 100644 --- a/includes/class-syndication-wp-xml-client.php +++ b/includes/class-syndication-wp-xml-client.php @@ -211,7 +211,8 @@ class Syndication_WP_XML_Client implements Syndication_Client { $value_array = $item->xpath( stripslashes( $save_location['xpath'] ) ); } if (isset($save_location['is_meta']) && $save_location['is_meta']) { - $meta_data[$save_location['field']] = (string)$value_array[0]; + $value_array = array_map( 'strval', $value_array ); + $meta_data[$save_location['field']] = $value_array; } else if ( isset($save_location['is_tax']) && $save_location['is_tax'] ) { //for some taxonomies, multiple values may be supplied in the field foreach ( $value_array as $value ) { -- GitLab