Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Extend the email hooks
Browse files Browse the repository at this point in the history
Extend the "EMAILS_SWITCH_LANGUAGE_ACTION" and "EMAILS_AFTER_SWITCH_LANGUAGE_ACTION" hooks by passing the language that we switch to as an argument. This gives external plugins more possibilities to hook into the process and e.g. reload their translations.
  • Loading branch information
mweimerskirch committed Jan 31, 2019
1 parent 772acc0 commit df276b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hyyan/WPI/Emails.php
Expand Up @@ -768,7 +768,7 @@ public function switchLanguage($language)
unload_textdomain('default');
unload_textdomain('woocommerce');#

do_action(HooksInterface::EMAILS_SWITCH_LANGUAGE_ACTION);
do_action(HooksInterface::EMAILS_SWITCH_LANGUAGE_ACTION, $language);

// set locale to order locale
$locale = apply_filters('locale', $language);
Expand All @@ -788,7 +788,7 @@ public function switchLanguage($language)
load_default_textdomain($language);

$woocommerce->load_plugin_textdomain();
do_action(HooksInterface::EMAILS_AFTER_SWITCH_LANGUAGE_ACTION);
do_action(HooksInterface::EMAILS_AFTER_SWITCH_LANGUAGE_ACTION, $language);

$wp_locale = new \WP_Locale();
}
Expand Down

0 comments on commit df276b3

Please sign in to comment.