wc_restore_locale()WC 3.1.0

Switch WooCommerce language to original.

No Hooks.

Return

null. Nothing (null).

Usage

wc_restore_locale();

Changelog

Since 3.1.0 Introduced.

wc_restore_locale() code WC 8.9.0

function wc_restore_locale() {
	global $wp_locale_switcher;

	if ( function_exists( 'restore_previous_locale' ) && isset( $wp_locale_switcher ) ) {
		restore_previous_locale();

		// Remove filter.
		remove_filter( 'plugin_locale', 'get_locale' );

		// Init WC locale.
		WC()->load_plugin_textdomain();
	}
}