wp_dropdown_languages

SummerySummery

Language selector.

Syntax

wp_dropdown_languages( string|array $args = array() )

ParametersParameters

$args

(string|array) (Optional) Array or string of arguments for outputting the language selector.

  • 'id'
    (string) ID attribute of the select element. Default 'locale'.
  • 'name'
    (string) Name attribute of the select element. Default 'locale'.
  • 'languages'
    (array) List of installed languages, contain only the locales.
  • 'translations'
    (array) List of available translations. Default result of wp_get_available_translations().
  • 'selected'
    (string) Language which should be selected.
  • 'echo'
    (bool|int) Whether to echo the generated markup. Accepts 0, 1, or their boolean equivalents. Default 1.
  • 'show_available_translations'
    (bool) Whether to show available translations. Default true.
  • 'show_option_site_default'
    (bool) Whether to show an option to fall back to the site's locale. Default false.
  • 'show_option_en_us'
    (bool) Whether to show an option for English (United States). Default true.

Default value: array()

ReturnReturn

(string) HTML dropdown list of languages.

SourceSource

File: wp-includes/l10n.php


			

ChangelogChangelog

Changelog
Version Description
5.1.0 Introduced the show_option_en_us argument.
4.7.0 Introduced the show_option_site_default argument.
4.3.0 Introduced the echo argument.
4.0.0 Introduced.

See alsoSee also

Scroll to Top