Created
July 5, 2019 17:33
-
-
Save imfaisalkh/1e2a6efd3c1777cb36c3d6fa7dd6524b to your computer and use it in GitHub Desktop.
Disabling sending certain email at certain events
This file contains 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 | |
#-----------------------------------------------------------------# | |
# Disable Emails Sending When Job Listing Approved | |
#-----------------------------------------------------------------# | |
function disable_mail_job_approved() { | |
remove_filters_with_method_name( 'pending_to_publish', 'listing_published_send_email' ); | |
remove_filters_with_method_name( 'pending_payment_to_publish', 'listing_published_send_email' ); | |
} | |
add_action( 'init', 'disable_mail_job_approved' ); | |
#-----------------------------------------------------------------# | |
# Disable Emails Sending When Resume Listing Approved | |
#-----------------------------------------------------------------# | |
function disable_mail_resume_approved() { | |
remove_filters_with_method_name( 'pending_to_publish', 'resume_published_send_email' ); | |
remove_filters_with_method_name( 'pending_payment_to_publish', 'resume_published_send_email' ); | |
} | |
add_action( 'init', 'disable_mail_resume_approved' ); | |
#-----------------------------------------------------------------# | |
# Disable Emails Sending When Resume Expires | |
#-----------------------------------------------------------------# | |
function disable_mail_resume_expires() { | |
remove_filters_with_method_name( 'transition_post_status', 'resume_expired_send_email', 10, 3 ); | |
} | |
add_action( 'init', 'disable_mail_resume_expires' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment