Last active
May 25, 2020 08:53
-
-
Save ideadude/ea7aa8e427ff3c616a5a36b971e2aef7 to your computer and use it in GitHub Desktop.
Disable the PHPMailer Code for PMPro
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
/** | |
* Disable the custom PHPMailer Code for PMPro. | |
* This will sometimes fix issues with broken/scrambled emails. | |
* Add this code to a custom plugin. https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Notice we run on the wp_mail_content_type hook on priority 15 to make sure | |
* we run after PMPro sets up the hook here: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/email.php#L127-L137 | |
*/ | |
function my_disable_pmpro_send_html() { | |
remove_action('phpmailer_init', 'pmpro_send_html'); | |
} | |
add_action( 'wp_mail_content_type', 'my_disable_pmpro_send_html', 15 ); | |
remove_filter( 'retrieve_password_message', 'pmpro_retrieve_password_message', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment