This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this changes the coupon clean frequency to every 30 mins instead of 4 hours | |
// max coupon cleaned in a single batch is 200 | |
add_action( 'automatewoo_loaded', function() { | |
remove_action( 'automatewoo_four_hourly_worker', [ 'AutomateWoo\Coupons', 'schedule_clean_expired' ] ); | |
add_action( 'automatewoo_thirty_minute_worker', [ 'AutomateWoo\Coupons', 'schedule_clean_expired' ] ); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// please note the _aw_customer_id meta data was added in version 3.5.1 | |
$user_id = 123; //example id | |
$customer = AutomateWoo\Customer_Factory::get_by_user_id( $user_id ); | |
$query_args = [ | |
'post_type' => 'shop_coupon', | |
'posts_per_page' => -1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this filter was added in AW 3.6.0 | |
add_filter( 'automatewoo/mailer/blacklist', function( $blacklist ){ | |
$blacklist[] = '[email protected]'; // block a single email | |
$blacklist[] = '@hotmail.com'; // block all emails from a domain | |
return $blacklist; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/variables', 'my_automatewoo_variables' ); | |
/** | |
* @param $variables array | |
* @return array | |
*/ | |
function my_automatewoo_variables( $variables ) { | |
$variables['order']['my_custom_date'] = dirname(__FILE__) . '/variable-my-custom-date.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/referral/is_potential_fraud', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adding a domain to the 'allowed_redirect_hosts' filter means AutomateWoo will use click tracking for URLs | |
* on this domain. Otherwise only URLs matching the site's domain will use click tracking for security reasons. | |
* | |
* @param array $hosts | |
* @return array | |
*/ | |
add_filter( 'allowed_redirect_hosts', function( $hosts ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/workflow/mailer', 'my_add_attachment_to_workflow_emails', 10, 2 ); | |
/** | |
* @param Mailer $mailer | |
* @param Workflow_Email $workflow_email | |
* @return Mailer | |
*/ | |
function my_add_attachment_to_workflow_emails( $mailer, $workflow_email ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WARNING! If you change the prefix all existing coupons will no longer work. | |
// Default coupon prefix is 'REF' | |
add_filter( 'automatewoo/referrals/coupon_prefix', function(){ | |
return 'MY_PREFIX'; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Please note, once the length is changed you may need to delete the advocate's existing coupon | |
// before new coupons with the new length will be generated. | |
add_filter( 'automatewoo/referrals/coupon_key_length', function(){ | |
return 5; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/referrals/account_tab_title', function() { | |
return 'My Custom Tab Name'; | |
}); |