Merge pull request #13424 from woocommerce/fix/reintroduce-virtual-coupons

Reintroduce virtual coupons by "un"deprecating the filter.
This commit is contained in:
Mike Jolley 2017-03-02 16:52:24 +00:00 committed by GitHub
commit 0b0066b2a0
1 changed files with 1 additions and 1 deletions

View File

@ -83,8 +83,8 @@ class WC_Coupon extends WC_Legacy_Coupon {
if ( $data instanceof WC_Coupon ) { if ( $data instanceof WC_Coupon ) {
$this->set_id( absint( $data->get_id() ) ); $this->set_id( absint( $data->get_id() ) );
} elseif ( $coupon = apply_filters( 'woocommerce_get_shop_coupon_data', false, $data ) ) { } 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 create an instance of WC_Coupon instead.', '2.7' );
$this->read_manual_coupon( $data, $coupon ); $this->read_manual_coupon( $data, $coupon );
return;
} elseif ( is_numeric( $data ) && 'shop_coupon' === get_post_type( $data ) ) { } elseif ( is_numeric( $data ) && 'shop_coupon' === get_post_type( $data ) ) {
$this->set_id( $data ); $this->set_id( $data );
} elseif ( ! empty( $data ) ) { } elseif ( ! empty( $data ) ) {