mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Multisite: Allow to set the site language of a new site to English.
An empty string in `WPLANG` is used to define the site language as `en_US`. The `! empty()` check didn't catch this case so that `wpmu_create_blog()` fell back to the network setting. Fixes #36918. git-svn-id: https://develop.svn.wordpress.org/trunk@38655 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -65,10 +65,14 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
|
||||
);
|
||||
|
||||
// Handle translation install for the new site.
|
||||
if ( ! empty( $_POST['WPLANG'] ) && wp_can_install_language_pack() ) {
|
||||
$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
|
||||
if ( $language ) {
|
||||
$meta['WPLANG'] = $language;
|
||||
if ( isset( $_POST['WPLANG'] ) ) {
|
||||
if ( '' === $_POST['WPLANG'] ) {
|
||||
$meta['WPLANG'] = ''; // en_US
|
||||
} elseif ( wp_can_install_language_pack() ) {
|
||||
$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
|
||||
if ( $language ) {
|
||||
$meta['WPLANG'] = $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user