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 shortcode support to to AutomateWoo email content. | |
* | |
* NOTE: Using shortcode's in emails is discouraged because most shortcodes don’t output valid HTML for email. | |
* Also many shortcodes simply don't work outside of the frontend template context. | |
*/ | |
add_filter( 'automatewoo_email_content', 'shortcode_unautop', 11 ); | |
add_filter( 'automatewoo_email_content', 'do_shortcode', 11 ); |
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/mailer/styles', 'my_automatewoo_custom_email_styles' ); | |
/** | |
* @param string $css | |
* @return string | |
*/ | |
function my_automatewoo_custom_email_styles( $css ) { |
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/coupon_data', 'my_automatewoo_referrals_custom_coupon_data' ); | |
/** | |
* @param array $coupon_data | |
* @return array | |
*/ | |
function my_automatewoo_referrals_custom_coupon_data( $coupon_data ) { | |
$coupon_data['discount_type'] = 'sign_up_fee_percent'; |
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/coupon_data', 'my_automatewoo_referrals_coupon_data' ); | |
/** | |
* @param array $coupon_data | |
* @return array | |
*/ | |
function my_automatewoo_referrals_coupon_data( $coupon_data ) { | |
$coupon_data['individual_use'] = 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 | |
add_filter( 'automatewoo/variables', 'my_automatewoo_variables' ); | |
/** | |
* @param $variables array | |
* @return array | |
*/ | |
function my_automatewoo_variables( $variables ) { | |
$variables['order']['delivery_date'] = dirname(__FILE__) . '/variable-order-delivery-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 | |
// change the from name | |
add_filter( 'automatewoo/mailer/from_name', function( $from_name ) { | |
return 'My Custom From Name'; | |
}); | |
// change the from address | |
add_filter( 'automatewoo/mailer/from_address', function( $from_email ) { | |
return '[email protected]'; |
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_action( 'admin_menu', 'my_maybe_remove_automatewoo_from_admin_menu', 5 ); | |
function my_maybe_remove_automatewoo_from_admin_menu() { | |
if ( ! current_user_can( 'administrator' ) ) { | |
remove_action( 'admin_menu', [ 'AutomateWoo\Admin', 'admin_menu' ] ); | |
} | |
} |
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/preview_data_layer', 'my_filter_automatewoo_preview_data_layer' ); | |
/** | |
* @param array $data | |
* @return array | |
*/ | |
function my_filter_automatewoo_preview_data_layer( $data ) { |
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/reward_amount', 'my_automatewoo_referral_reward_amount', 10, 3 ); | |
/** | |
* @param $reward_amount | |
* @param AW_Model_Referral_Advocate $advocate | |
* @param WC_Order $order | |
* @return mixed | |
*/ |
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/invite_email/mailer', 'my_filter_referrals_invite_email', 10, 2 ); | |
/** | |
* @param AW_Mailer $mailer | |
* @param AW_Referrals_Referral_Invite_Email $invite | |
* @return AW_Mailer | |
*/ | |
function my_filter_referrals_invite_email( $mailer, $invite ) { |