mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Only use the 'Installed' optgroup in wp_dropdown_languages() if it's needed.
see #30335. git-svn-id: https://develop.svn.wordpress.org/trunk@30340 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
112061668f
commit
6e587aed5f
@ -910,7 +910,9 @@ function wp_dropdown_languages( $args = array() ) {
|
||||
$structure = array();
|
||||
|
||||
// List installed languages.
|
||||
$structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
|
||||
if ( $args['show_available_translations'] ) {
|
||||
$structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
|
||||
}
|
||||
$structure[] = '<option value="" lang="en" data-installed="1">English (United States)</option>';
|
||||
foreach ( $languages as $language ) {
|
||||
$structure[] = sprintf(
|
||||
@ -921,7 +923,9 @@ function wp_dropdown_languages( $args = array() ) {
|
||||
esc_html( $language['native_name'] )
|
||||
);
|
||||
}
|
||||
$structure[] = '</optgroup>';
|
||||
if ( $args['show_available_translations'] ) {
|
||||
$structure[] = '</optgroup>';
|
||||
}
|
||||
|
||||
// List available translations.
|
||||
if ( ! empty( $translations ) && $args['show_available_translations'] ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user