[2.6] [REST API] Fixed the type of the params from _product_attributes in the legacy endpoints too #11200

This commit is contained in:
Claudio Sanches 2016-06-21 18:52:40 -03:00
parent 43b4d1e5eb
commit 78adee9dcb
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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