get_available_languages

SummerySummery

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

Syntax

get_available_languages( string $dir = null )

DescriptionDescription

The default directory is WP_LANG_DIR.

ParametersParameters

$dir

(string) (Optional) A directory to search for language files. Default WP_LANG_DIR.

Default value: null

ReturnReturn

(string[]) 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.

SourceSource

File: wp-includes/l10n.php


			

ChangelogChangelog

Changelog
Version Description
4.7.0 The results are now filterable with the 'get_available_languages' filter.
3.0.0 Introduced.
Scroll to Top