WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/format code lang

Contents

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.