From 2fb06e4c29cb73cf1e1269d8d8503b538a957aa5 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 3 Apr 2015 15:01:41 -0300 Subject: [PATCH] [API] Fixed the position type for attributes and images --- includes/api/class-wc-api-products.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/class-wc-api-products.php b/includes/api/class-wc-api-products.php index eb84c4ba214..0f84feb7e7b 100644 --- a/includes/api/class-wc-api-products.php +++ b/includes/api/class-wc-api-products.php @@ -1609,7 +1609,7 @@ class WC_API_Products extends WC_API_Resource { 'src' => current( $attachment ), 'title' => get_the_title( $attachment_id ), 'alt' => get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ), - 'position' => $position, + 'position' => (int) $position, ); } @@ -1821,7 +1821,7 @@ class WC_API_Products extends WC_API_Resource { $attributes[] = array( 'name' => wc_attribute_label( $attribute['name'] ), 'slug' => str_replace( 'pa_', '', $attribute['name'] ), - 'position' => $attribute['position'], + 'position' => (int) $attribute['position'], 'visible' => (bool) $attribute['is_visible'], 'variation' => (bool) $attribute['is_variation'], 'options' => array_map( 'trim', $options ),