Description
Returns the language for a language code.
Usage
<?php format_code_lang( $code ); ?>
Parameters
- $code
- (string) (optional) The two-letter language code.
- Default: Empty string
Return
- (string)
- The language corresponding to $code if it exists. If it does not exist, then the first two letters of $code is returned.
Examples
<?php
$code = 'da';
$language = format_code_lang( $code );
echo $language; // 'Danish'
?>
Notes
- Uses filter 'lang_codes' to filter the languages before formatting $code.
Change Log
Source File
format_code_lang() is located in wp-admin/includes/ms.php
.