From abac5e2160dfa9fc3ed77dcba1aa8025acc13f16 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Sun, 22 May 2016 18:19:45 -0300 Subject: [PATCH] [REST API] Fixed batch create coupons --- includes/api/class-wc-rest-coupons-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/class-wc-rest-coupons-controller.php b/includes/api/class-wc-rest-coupons-controller.php index 2f484ba2e84..f0845e22059 100644 --- a/includes/api/class-wc-rest-coupons-controller.php +++ b/includes/api/class-wc-rest-coupons-controller.php @@ -298,7 +298,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Posts_Controller { * @return bool|WP_Error */ protected function add_post_meta_fields( $post, $request ) { - $data = $request->get_json_params(); + $data = array_filter( $request->get_params() ); $defaults = array( 'discount_type' => 'fixed_cart',