From 4522b68a47c48f1a2fb29daef8312bb926588e2b Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 28 Oct 2015 16:31:05 -0200 Subject: [PATCH] [2.4] [API] Avoid undefined $taxonomy warnings while save variable attributes, closes #9456 --- includes/api/class-wc-api-products.php | 5 +++-- includes/api/v2/class-wc-api-products.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/api/class-wc-api-products.php b/includes/api/class-wc-api-products.php index 89dc9272e48..ae0e4e131fe 100644 --- a/includes/api/class-wc-api-products.php +++ b/includes/api/class-wc-api-products.php @@ -1298,8 +1298,8 @@ class WC_API_Products extends WC_API_Resource { $attributes = array(); foreach ( $data['attributes'] as $attribute ) { - $is_taxonomy = 0; - $taxonomy = 0; + $is_taxonomy = 0; + $taxonomy = 0; if ( ! isset( $attribute['name'] ) ) { continue; @@ -1925,6 +1925,7 @@ class WC_API_Products extends WC_API_Resource { continue; } + $taxonomy = 0; $_attribute = array(); if ( isset( $attribute['slug'] ) ) { diff --git a/includes/api/v2/class-wc-api-products.php b/includes/api/v2/class-wc-api-products.php index e8ef56ce9f3..ca622a12b3c 100644 --- a/includes/api/v2/class-wc-api-products.php +++ b/includes/api/v2/class-wc-api-products.php @@ -845,8 +845,8 @@ class WC_API_Products extends WC_API_Resource { $attributes = array(); foreach ( $data['attributes'] as $attribute ) { - $is_taxonomy = 0; - $taxonomy = 0; + $is_taxonomy = 0; + $taxonomy = 0; if ( ! isset( $attribute['name'] ) ) { continue; @@ -1462,6 +1462,7 @@ class WC_API_Products extends WC_API_Resource { continue; } + $taxonomy = 0; $_attribute = array(); if ( isset( $attribute['slug'] ) ) {