Automattic\WooCommerce\Admin\RemoteInboxNotifications
SpecRunner::get_locale()
Get the locale for the WordPress locale, or fall back to the en_US locale.
{} Это метод класса: SpecRunner{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$result = SpecRunner::get_locale( $locales );
- $locales(Array) (обязательный)
- The locales to search through.
Код SpecRunner::get_locale() SpecRunner::get locale WC 6.4.1
public static function get_locale( $locales ) { $wp_locale = get_locale(); $matching_wp_locales = array_values( array_filter( $locales, function( $l ) use ( $wp_locale ) { return $wp_locale === $l->locale; } ) ); if ( 0 !== count( $matching_wp_locales ) ) { return $matching_wp_locales[0]; } // Fall back to en_US locale. $en_us_locales = array_values( array_filter( $locales, function( $l ) { return 'en_US' === $l->locale; } ) ); if ( 0 !== count( $en_us_locales ) ) { return $en_us_locales[0]; } return null; }