Make WordPress Core


Ignore:
Timestamp:
11/14/2014 03:23:57 AM (10 years ago)
Author:
nacin
Message:

Only use the 'Installed' optgroup in wp_dropdown_languages() if it's needed.

see #30335.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r30335 r30340  
    911911
    912912    // List installed languages.
    913     $structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
     913    if ( $args['show_available_translations'] ) {
     914        $structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
     915    }
    914916    $structure[] = '<option value="" lang="en" data-installed="1">English (United States)</option>';
    915917    foreach ( $languages as $language ) {
     
    922924        );
    923925    }
    924     $structure[] = '</optgroup>';
     926    if ( $args['show_available_translations'] ) {
     927        $structure[] = '</optgroup>';
     928    }
    925929
    926930    // List available translations.
Note: See TracChangeset for help on using the changeset viewer.