From df8506f52314f66d85740b2698c4da3222cfec57 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Fri, 14 Jul 2017 21:08:43 +0000 Subject: [PATCH] Multisite: Use `get_network_option()` for language in `wpmu_create_blog()`. Before this changeset, the language of a new site would always result in the language of the current network, regardless of the `$site_id` parameter passed that actually determines the network for the site. Now the correct `WPLANG` value is used in such cases. Alongside this change, a few minor documentation changes around the function have been made to account for the current naming conventions of sites and networks. Props spacedmonkey. Fixes #40503. Built from https://develop.svn.wordpress.org/trunk@41058 git-svn-id: http://core.svn.wordpress.org/trunk@40908 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 10 +++++----- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 15c932a608..3308c07ed0 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1152,13 +1152,13 @@ function wpmu_create_user( $user_name, $password, $email ) { * 'spam', 'deleted', or 'lang_id') the given site status(es) will be * updated. Otherwise, keys and values will be used to set options for * the new site. Default empty array. - * @param int $site_id Optional. Only relevant on multi-network installs. - * @return int|WP_Error Returns WP_Error object on failure, int $blog_id on success + * @param int $site_id Optional. Network ID. Only relevant on multi-network installs. + * @return int|WP_Error Returns WP_Error object on failure, the new site ID on success. */ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) { $defaults = array( 'public' => 0, - 'WPLANG' => get_site_option( 'WPLANG' ), + 'WPLANG' => get_network_option( $site_id, 'WPLANG' ), ); $meta = wp_parse_args( $meta, $defaults ); @@ -1208,11 +1208,11 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s * * @since MU * - * @param int $blog_id Blog ID. + * @param int $blog_id Site ID. * @param int $user_id User ID. * @param string $domain Site domain. * @param string $path Site path. - * @param int $site_id Site ID. Only relevant on multi-network installs. + * @param int $site_id Network ID. Only relevant on multi-network installs. * @param array $meta Meta data. Used to set initial site options. */ do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 4d75b6522d..570416b763 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41050'; +$wp_version = '4.9-alpha-41058'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.