Merge pull request #13424 from woocommerce/fix/reintroduce-virtual-coupons
Reintroduce virtual coupons by "un"deprecating the filter.
This commit is contained in:
commit
0b0066b2a0
|
@ -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 create 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 ) ) {
|
||||
|
|
Loading…
Reference in New Issue