Skip to content

Instantly share code, notes, and snippets.

@danielbitzer
Created October 5, 2017 09:59
Show Gist options
  • Save danielbitzer/70a54ca40e4db57658daef1fac71b53e to your computer and use it in GitHub Desktop.
Save danielbitzer/70a54ca40e4db57658daef1fac71b53e to your computer and use it in GitHub Desktop.
AutomateWoo - Change workflow generated coupon lengths (since v3.3.0)
<?php
add_filter( 'automatewoo/coupon_generator/key_length', 'my_filter_automatewoo_coupon_length', 10, 2 );
/**
* @param int $length
* @param AutomateWoo\Coupon_Generator $generator
* @return int
*/
function my_filter_automatewoo_coupon_length( $length, $generator ) {
// please note that this length excludes the length of the coupon prefix
return 8;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment