Make WordPress Core


Ignore:
Timestamp:
02/13/2015 11:22:38 AM (10 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r31090 r31447  
    897897                'language'    => $translation['language'],
    898898                'native_name' => $translation['native_name'],
    899                 'lang'        => $translation['iso'][1],
     899                'lang'        => current( $translation['iso'] ),
    900900            );
    901901
     
    943943                '<option value="%s" lang="%s"%s>%s</option>',
    944944                esc_attr( $translation['language'] ),
    945                 esc_attr( $translation['iso'][1] ),
     945                esc_attr( current( $translation['iso'] ) ),
    946946                selected( $translation['language'], $args['selected'], false ),
    947947                esc_html( $translation['native_name'] )
Note: See TracChangeset for help on using the changeset viewer.