Make WordPress Core


Ignore:
Timestamp:
07/14/2017 09:07:17 PM (8 years ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

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

    r40951 r41058  
    11531153 *                        updated. Otherwise, keys and values will be used to set options for
    11541154 *                        the new site. Default empty array.
    1155  * @param int    $site_id Optional. Only relevant on multi-network installs.
    1156  * @return int|WP_Error Returns WP_Error object on failure, int $blog_id on success
     1155 * @param int    $site_id Optional. Network ID. Only relevant on multi-network installs.
     1156 * @return int|WP_Error Returns WP_Error object on failure, the new site ID on success.
    11571157 */
    11581158function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
    11591159    $defaults = array(
    11601160        'public' => 0,
    1161         'WPLANG' => get_site_option( 'WPLANG' ),
     1161        'WPLANG' => get_network_option( $site_id, 'WPLANG' ),
    11621162    );
    11631163    $meta = wp_parse_args( $meta, $defaults );
     
    12091209     * @since MU
    12101210     *
    1211      * @param int    $blog_id Blog ID.
     1211     * @param int    $blog_id Site ID.
    12121212     * @param int    $user_id User ID.
    12131213     * @param string $domain  Site domain.
    12141214     * @param string $path    Site path.
    1215      * @param int    $site_id Site ID. Only relevant on multi-network installs.
     1215     * @param int    $site_id Network ID. Only relevant on multi-network installs.
    12161216     * @param array  $meta    Meta data. Used to set initial site options.
    12171217     */
Note: See TracChangeset for help on using the changeset viewer.