From 78adee9dcb3093455ff3fb27e12a8e361a6094ee Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 21 Jun 2016 18:52:40 -0300 Subject: [PATCH] [2.6] [REST API] Fixed the type of the params from _product_attributes in the legacy endpoints too #11200 --- includes/api/legacy/v2/class-wc-api-products.php | 4 ++-- includes/api/legacy/v3/class-wc-api-products.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/api/legacy/v2/class-wc-api-products.php b/includes/api/legacy/v2/class-wc-api-products.php index 39cebfb992a..68ec12f5efd 100644 --- a/includes/api/legacy/v2/class-wc-api-products.php +++ b/includes/api/legacy/v2/class-wc-api-products.php @@ -914,7 +914,7 @@ class WC_API_Products extends WC_API_Resource { $attributes[ $taxonomy ] = array( 'name' => $taxonomy, 'value' => '', - 'position' => isset( $attribute['position'] ) ? absint( $attribute['position'] ) : 0, + 'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0', 'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0, 'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0, 'is_taxonomy' => $is_taxonomy @@ -935,7 +935,7 @@ class WC_API_Products extends WC_API_Resource { $attributes[ $attribute_slug ] = array( 'name' => wc_clean( $attribute['name'] ), 'value' => $values, - 'position' => isset( $attribute['position'] ) ? absint( $attribute['position'] ) : 0, + 'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0', 'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0, 'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0, 'is_taxonomy' => $is_taxonomy diff --git a/includes/api/legacy/v3/class-wc-api-products.php b/includes/api/legacy/v3/class-wc-api-products.php index 2d5e184ef77..1629989a211 100644 --- a/includes/api/legacy/v3/class-wc-api-products.php +++ b/includes/api/legacy/v3/class-wc-api-products.php @@ -1399,7 +1399,7 @@ class WC_API_Products extends WC_API_Resource { $attributes[ $taxonomy ] = array( 'name' => $taxonomy, 'value' => '', - 'position' => isset( $attribute['position'] ) ? absint( $attribute['position'] ) : 0, + 'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0', 'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0, 'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0, 'is_taxonomy' => $is_taxonomy @@ -1420,7 +1420,7 @@ class WC_API_Products extends WC_API_Resource { $attributes[ $attribute_slug ] = array( 'name' => wc_clean( $attribute['name'] ), 'value' => $values, - 'position' => isset( $attribute['position'] ) ? absint( $attribute['position'] ) : 0, + 'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0', 'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0, 'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0, 'is_taxonomy' => $is_taxonomy