get_available_languages
Filters the list of available language codes.
Usage
add_filter( 'get_available_languages', 'wp_kama_get_available_languages_filter', 10, 2 ); /** * Function for `get_available_languages` filter-hook. * * @param string[] $languages An array of available language codes. * @param string $dir The directory where the language files were found. * * @return string[] */ function wp_kama_get_available_languages_filter( $languages, $dir ){ // filter... return $languages; }
- $languages(string[])
- An array of available language codes.
- $dir(string)
- The directory where the language files were found.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
get_available_languages
wp-includes/l10n.php 1499
return apply_filters( 'get_available_languages', array_unique( $languages ), $dir );