Skip to content

Instantly share code, notes, and snippets.

@emilushi
Last active March 11, 2019 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilushi/646fcb2b5c67c3b607cd0c2cd42ec624 to your computer and use it in GitHub Desktop.
Save emilushi/646fcb2b5c67c3b607cd0c2cd42ec624 to your computer and use it in GitHub Desktop.
Stop Weglot from translating emails sent using wp_mail
<?php
if (class_exists(\WeglotWP\Actions\Email_Translate_Weglot::class) && ! in_array('weglot/weglot.php', apply_filters('active_plugins', get_option('active_plugins')), true)) {
remove_filter('wp_mail', [\WeglotWP\Actions\Email_Translate_Weglot::class, 'weglot_translate_emails']);
}
@emilushi
Copy link
Author

Im using Weglot for translating an WordPress website from English to German and on the website we are using Gravity Forms to handle form submissions. On one of the email sent from a visitor in German language we noticed that the email text was sent on a mix language between English and German.

So for anyone using Weglot and having same issue include the above into your theme's function.php to remove the email translation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment