gform_coupons_is_valid_code

Description

Overrides coupon code alphanumeric checking.

Usage

add_filter( 'gform_coupons_is_valid_code', 'your_function_name', 10, 2 );

Parameters

  • $is_alphanumeric bool

    If the coupon code is alphanumeric.

  • $field Field Object

    The field object.

Examples

add_filter( 'gform_coupons_is_valid_code', 'mark_coupon_valid', 10, 2 );
function mark_coupon_valid( $alphanumeric, $field ){
	return true;
}

Placement

This code should be placed in the functions.php file of your active theme.

Since

This filter was added in Gravity Forms Coupons Add-On version 2.4.

Source Code

This filter is located in GFCoupons::check_if_duplicate_coupon_code() in gravityformscoupons/class-gf-coupons.php.