plugin_locale
Это хук WordPress - plugin_locale. Плагин его просто использует.
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 string $locale The plugin's current locale. * @param string $domain Text domain. Unique identifier for retrieving translated strings. * * @return string */ function wp_kama_plugin_locale_filter( $locale, $domain ){ // filter... return $locale; }
- $locale(строка)
- The plugin's current locale.
- $domain(строка)
- Text domain. Unique identifier for retrieving translated strings.
Где вызывается хук
plugin_locale
woocommerce/includes/class-woocommerce.php 874
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment
Где используется хук в WooCommerce
woocommerce/includes/wc-core-functions.php 2216
add_filter( 'plugin_locale', 'get_locale' );
woocommerce/includes/wc-core-functions.php 2235
remove_filter( 'plugin_locale', 'get_locale' );