diff --git a/includes/api/class-wc-rest-products-controller.php b/includes/api/class-wc-rest-products-controller.php index 17aa661b07d..738e716e54f 100644 --- a/includes/api/class-wc-rest-products-controller.php +++ b/includes/api/class-wc-rest-products-controller.php @@ -334,7 +334,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { $default = array(); if ( $product->is_type( 'variable' ) ) { - foreach ( (array) get_post_meta( $product->id, '_default_attributes', true ) as $key => $value ) { + foreach ( array_filter( (array) get_post_meta( $product->id, '_default_attributes', true ), 'strlen' ) as $key => $value ) { if ( 0 === strpos( $key, 'pa_' ) ) { $default[] = array( 'id' => wc_attribute_taxonomy_id_by_name( $key ), @@ -1012,10 +1012,10 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { $attributes[ $attribute_name ] = array( 'name' => $attribute_name, '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' => true, + 'is_taxonomy' => 1, ); } @@ -1033,10 +1033,10 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { $attributes[ sanitize_title( $attribute_name ) ] = array( 'name' => $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' => false, + 'is_taxonomy' => 0, ); } } 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 diff --git a/includes/class-wc-geo-ip.php b/includes/class-wc-geo-ip.php index 09ae56ecde6..9f6d29d3d66 100644 --- a/includes/class-wc-geo-ip.php +++ b/includes/class-wc-geo-ip.php @@ -1310,8 +1310,6 @@ class WC_Geo_IP { || ( $this->databaseType == self::GEOIP_ISP_EDITION_V6 ) || ( $this->databaseType == self::GEOIP_LOCATIONA_EDITION ) || ( $this->databaseType == self::GEOIP_ACCURACYRADIUS_EDITION ) - || ( $this->databaseType == self::GEOIP_CITY_EDITION_REV0_V6 ) - || ( $this->databaseType == self::GEOIP_CITY_EDITION_REV1_V6 ) || ( $this->databaseType == self::GEOIP_NETSPEED_EDITION_REV1 ) || ( $this->databaseType == self::GEOIP_NETSPEED_EDITION_REV1_V6 ) || ( $this->databaseType == self::GEOIP_USERTYPE_EDITION )