WC_Cart::is_coupon_emails_allowed
Deprecated since 9.0.0 In favor of static method Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed.. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Checks if the given email address(es) matches the ones specified on the coupon.
Method of the class: WC_Cart{}
No Hooks.
Returns
true|false.
Usage
$WC_Cart = new WC_Cart(); $WC_Cart->is_coupon_emails_allowed( $check_emails, $restrictions );
- $check_emails(array) (required)
- Array of customer email addresses.
- $restrictions(array) (required)
- Array of allowed email addresses.
Changelog
| Deprecated since 9.0.0 | In favor of static method Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed. |
WC_Cart::is_coupon_emails_allowed() WC Cart::is coupon emails allowed code WC 10.7.0
public function is_coupon_emails_allowed( $check_emails, $restrictions ) {
wc_doing_it_wrong(
'WC_Cart::is_coupon_emails_allowed',
__( 'This method has been deprecated and will be removed soon. Use Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed instead.', 'woocommerce' ),
'9.0.0'
);
return DiscountsUtil::is_coupon_emails_allowed( $check_emails, $restrictions );
}