From 428e32bfa9b4148929a2b675462e70d0320b606c Mon Sep 17 00:00:00 2001 From: Boro Sitnikovski Date: Wed, 1 Mar 2017 22:49:21 +0100 Subject: [PATCH] Reintroduce virtual coupons by "un"deprecating the filter. We also need to return to skip CRUD processing. --- includes/class-wc-coupon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-coupon.php b/includes/class-wc-coupon.php index 459cba03494..852056a086b 100644 --- a/includes/class-wc-coupon.php +++ b/includes/class-wc-coupon.php @@ -83,8 +83,8 @@ class WC_Coupon extends WC_Legacy_Coupon { if ( $data instanceof WC_Coupon ) { $this->set_id( absint( $data->get_id() ) ); } elseif ( $coupon = apply_filters( 'woocommerce_get_shop_coupon_data', false, $data ) ) { - wc_doing_it_wrong( 'woocommerce_get_shop_coupon_data', 'Reading a manual coupon via woocommerce_get_shop_coupon_data has been deprecated. Please sent an instance of WC_Coupon instead.', '2.7' ); $this->read_manual_coupon( $data, $coupon ); + return; } elseif ( is_numeric( $data ) && 'shop_coupon' === get_post_type( $data ) ) { $this->set_id( $data ); } elseif ( ! empty( $data ) ) {