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

see #30335.

Built from https://develop.svn.wordpress.org/trunk@30340


git-svn-id: http://core.svn.wordpress.org/trunk@30339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-11-14 03:24:23 +00:00
parent 560574da45
commit b922be3f71
2 changed files with 7 additions and 3 deletions

View File

@ -910,7 +910,9 @@ function wp_dropdown_languages( $args = array() ) {
$structure = array(); $structure = array();
// List installed languages. // List installed languages.
if ( $args['show_available_translations'] ) {
$structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">'; $structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
}
$structure[] = '<option value="" lang="en" data-installed="1">English (United States)</option>'; $structure[] = '<option value="" lang="en" data-installed="1">English (United States)</option>';
foreach ( $languages as $language ) { foreach ( $languages as $language ) {
$structure[] = sprintf( $structure[] = sprintf(
@ -921,7 +923,9 @@ function wp_dropdown_languages( $args = array() ) {
esc_html( $language['native_name'] ) esc_html( $language['native_name'] )
); );
} }
if ( $args['show_available_translations'] ) {
$structure[] = '</optgroup>'; $structure[] = '</optgroup>';
}
// List available translations. // List available translations.
if ( ! empty( $translations ) && $args['show_available_translations'] ) { if ( ! empty( $translations ) && $args['show_available_translations'] ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-alpha-30339'; $wp_version = '4.1-alpha-30340';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.