WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/format code lang

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.

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.