From 344a0d92c6671ef964e2e83fd8a83431cd76c06d Mon Sep 17 00:00:00 2001 From: claudiosmweb Date: Tue, 4 Mar 2014 23:42:36 -0300 Subject: [PATCH] improved the validation for WC_API_Customers::edit_customer() and WC_API_Customers::delete_customer() --- includes/api/class-wc-api-customers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/class-wc-api-customers.php b/includes/api/class-wc-api-customers.php index b3f762b56ab..940fb52c74b 100644 --- a/includes/api/class-wc-api-customers.php +++ b/includes/api/class-wc-api-customers.php @@ -373,7 +373,7 @@ class WC_API_Customers extends WC_API_Resource { // Return the validate error. if ( is_wp_error( $id ) ) { - return new WP_Error( $id->get_error_code(), $id->get_error_message(), $id->get_error_data() ); + return $id; } // Customer email. @@ -408,7 +408,7 @@ class WC_API_Customers extends WC_API_Resource { // Return the validate error. if ( is_wp_error( $id ) ) { - return new WP_Error( $id->get_error_code(), $id->get_error_message(), $id->get_error_data() ); + return $id; } return $this->delete( $id, 'customer' );