WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

get_available_languages() WP 3.0.0

Get all available languages based on the presence of *.mo files in a given directory.

The default directory is WP_LANG_DIR.

Хуки из функции
Возвращает

Массив. An array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names.

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

get_available_languages( $dir );
$dir(строка)
A directory to search for language files.
По умолчанию: WP_LANG_DIR

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

С версии 3.0.0 Введена.
С версии 4.7.0 The results are now filterable with the 'get_available_languages' filter.

Код get available languages: wp-includes/l10n.php WP 5.2.2

<?php
function get_available_languages( $dir = null ) {
	$languages = array();

	$lang_files = glob( ( is_null( $dir ) ? WP_LANG_DIR : $dir ) . '/*.mo' );
	if ( $lang_files ) {
		foreach ( $lang_files as $lang_file ) {
			$lang_file = basename( $lang_file, '.mo' );
			if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) &&
				0 !== strpos( $lang_file, 'admin-' ) ) {
				$languages[] = $lang_file;
			}
		}
	}

	/**
	 * Filters the list of available language codes.
	 *
	 * @since 4.7.0
	 *
	 * @param array  $languages An array of available language codes.
	 * @param string $dir       The directory where the language files were found.
	 */
	return apply_filters( 'get_available_languages', $languages, $dir );
}