plugin_locale хук-фильтрWC 1.0

Filter to adjust the WooCommerce locale to use for translations.

Использование

add_filter( 'plugin_locale', 'wp_kama_plugin_locale_filter', 10, 2 );

/**
 * Function for `plugin_locale` filter-hook.
 * 
 * @param  $locale 
 * @param  $string 
 *
 * @return 
 */
function wp_kama_plugin_locale_filter( $locale, $string ){

	// filter...
	return $locale;
}
$locale
-
$string
-

Где вызывается хук

WooCommerce::load_plugin_textdomain()
plugin_locale
woocommerce/includes/class-woocommerce.php 680
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment

Где используется хук в WooCommerce

woocommerce/includes/wc-core-functions.php 2194
add_filter( 'plugin_locale', 'get_locale' );
woocommerce/includes/wc-core-functions.php 2211
remove_filter( 'plugin_locale', 'get_locale' );