Only output an optgroup for installed languages in `wp_dropdown_languages()` if translations are available.
See #30335 Built from https://develop.svn.wordpress.org/trunk@30495 git-svn-id: http://core.svn.wordpress.org/trunk@30484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
57e358da63
commit
3ace1fac81
|
@ -905,13 +905,15 @@ function wp_dropdown_languages( $args = array() ) {
|
|||
}
|
||||
}
|
||||
|
||||
$translations_available = ( ! empty( $translations ) && $args['show_available_translations'] );
|
||||
|
||||
printf( '<select name="%s" id="%s">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) );
|
||||
|
||||
// Holds the HTML markup.
|
||||
$structure = array();
|
||||
|
||||
// List installed languages.
|
||||
if ( $args['show_available_translations'] ) {
|
||||
if ( $translations_available ) {
|
||||
$structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
|
||||
}
|
||||
$structure[] = '<option value="" lang="en" data-installed="1">English (United States)</option>';
|
||||
|
@ -924,12 +926,12 @@ function wp_dropdown_languages( $args = array() ) {
|
|||
esc_html( $language['native_name'] )
|
||||
);
|
||||
}
|
||||
if ( $args['show_available_translations'] ) {
|
||||
if ( $translations_available ) {
|
||||
$structure[] = '</optgroup>';
|
||||
}
|
||||
|
||||
// List available translations.
|
||||
if ( ! empty( $translations ) && $args['show_available_translations'] ) {
|
||||
if ( $translations_available ) {
|
||||
$structure[] = '<optgroup label="' . esc_attr_x( 'Available', 'translations' ) . '">';
|
||||
foreach ( $translations as $translation ) {
|
||||
$structure[] = sprintf(
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.1-beta2-30494';
|
||||
$wp_version = '4.1-beta2-30495';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue