acf_get_locale()ACF 5.5.0

acf_get_locale

Returns the current locale.

Хуки из функции

Возвращает

Строку.

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

acf_get_locale();

Список изменений

С версии 5.5.0 Введена.

Код acf_get_locale() ACF 6.0.4

function acf_get_locale() {

	// Determine local.
	$locale = determine_locale();

	// Fallback to parent language for regions without translation.
	// https://wpastra.com/docs/complete-list-wordpress-locale-codes/
	$langs = array(
		'az_TR' => 'az',        // Azerbaijani (Turkey)
		'zh_HK' => 'zh_TW',     // Chinese (Hong Kong)
		'fr_BE' => 'fr_FR',     // French (Belgium)
		'nn_NO' => 'nb_NO',     // Norwegian (Nynorsk)
		'fa_AF' => 'fa_IR',     // Persian (Afghanistan)
		'ru_UA' => 'ru_RU',     // Russian (Ukraine)
	);
	if ( isset( $langs[ $locale ] ) ) {
		$locale = $langs[ $locale ];
	}

	/**
	 * Filters the determined local.
	 *
	 * @date    8/1/19
	 * @since   5.7.10
	 *
	 * @param   string $locale The local.
	 */
	return apply_filters( 'acf/get_locale', $locale );
}