Merge branch 'master' into orders-crud-classes
This commit is contained in:
commit
54f61a41ba
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue