function exists

This commit is contained in:
Mike Jolley 2017-06-06 12:54:49 +01:00
parent 67a0637417
commit 09d43670fc
1 changed files with 7 additions and 5 deletions

View File

@ -1653,11 +1653,13 @@ function wc_switch_to_site_locale() {
* @since 3.1.0
*/
function wc_restore_locale() {
restore_previous_locale();
if ( function_exists( 'restore_previous_locale' ) ) {
restore_previous_locale();
// Remove filter.
remove_filter( 'plugin_locale', 'get_locale' );
// Remove filter.
remove_filter( 'plugin_locale', 'get_locale' );
// Init WC locale.
WC()->load_plugin_textdomain();
// Init WC locale.
WC()->load_plugin_textdomain();
}
}