Action
wpml_switch_language
On this page
Calls WPML's action to switch the active language.
RestroPress fires this WPML action to switch to the order's language before building order emails, and again to restore the original language after the emails have been sent. The language switch applies to the current request only.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$language_code | string | The language code to switch to. |
Example#
add_action( 'wpml_switch_language', 'my_log_language_switch', 10, 1 );
function my_log_language_switch( $language_code ) {
error_log( 'Language switched to ' . $language_code );
}
Notes#
Fired from rpress_wpml_switch_language_for_order() with the order's language and from rpress_wpml_restore_language() with the previously active language.
Source#
Fired from:
includes/plugin-compatibility.php(line 629), inrpress_wpml_switch_language_for_order()includes/plugin-compatibility.php(line 665), inrpress_wpml_restore_language()
See also#
Was this page helpful?
