Avoid a PHP notice in wp_install_language_form() and wp_dropdown_languages() if the language doesn't have a ISO 639-1 code.

props barrykooij.
fixes #31319.
Built from https://develop.svn.wordpress.org/trunk@31447


git-svn-id: http://core.svn.wordpress.org/trunk@31428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2015-02-13 11:23:26 +00:00
parent 7b9d981a54
commit e2f5a8094e
3 changed files with 5 additions and 5 deletions

View File

@@ -896,7 +896,7 @@ function wp_dropdown_languages( $args = array() ) {
$languages[] = array(
'language' => $translation['language'],
'native_name' => $translation['native_name'],
'lang' => $translation['iso'][1],
'lang' => current( $translation['iso'] ),
);
// Remove installed language from available translations.
@@ -942,7 +942,7 @@ function wp_dropdown_languages( $args = array() ) {
$structure[] = sprintf(
'<option value="%s" lang="%s"%s>%s</option>',
esc_attr( $translation['language'] ),
esc_attr( $translation['iso'][1] ),
esc_attr( current( $translation['iso'] ) ),
selected( $translation['language'], $args['selected'], false ),
esc_html( $translation['native_name'] )
);