Make WordPress Core

Ticket #40503: 40503.diff

File 40503.diff, 2.2 KB (added by spacedmonkey, 7 years ago)
  • src/wp-includes/ms-functions.php

     
    11381138 * @param string $title   The new site's title.
    11391139 * @param int    $user_id The user ID of the new site's admin.
    11401140 * @param array  $meta    Optional. Used to set initial site options.
    1141  * @param int    $site_id Optional. Only relevant on multi-network installs.
     1141 * @param int    $network_id Optional. Only relevant on multi-network installs.
    11421142 * @return int|WP_Error Returns WP_Error object on failure, int $blog_id on success
    11431143 */
    1144 function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
     1144function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $network_id = 1 ) {
    11451145        $defaults = array(
    11461146                'public' => 0,
    1147                 'WPLANG' => get_site_option( 'WPLANG' ),
     1147                'WPLANG' => get_network_option( $network_id, 'WPLANG' ),
    11481148        );
    11491149        $meta = wp_parse_args( $meta, $defaults );
    11501150
     
    11601160                $path = '/';
    11611161
    11621162        // Check if the domain has been used already. We should return an error message.
    1163         if ( domain_exists($domain, $path, $site_id) )
     1163        if ( domain_exists($domain, $path, $network_id) )
    11641164                return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) );
    11651165
    11661166        if ( ! wp_installing() ) {
    11671167                wp_installing( true );
    11681168        }
    11691169
    1170         if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
     1170        if ( ! $blog_id = insert_blog($domain, $path, $network_id) )
    11711171                return new WP_Error('insert_blog', __('Could not create site.'));
    11721172
    11731173        switch_to_blog($blog_id);
     
    11981198         * @param int    $user_id User ID.
    11991199         * @param string $domain  Site domain.
    12001200         * @param string $path    Site path.
    1201          * @param int    $site_id Site ID. Only relevant on multi-network installs.
     1201         * @param int    $network_id Network ID. Only relevant on multi-network installs.
    12021202         * @param array  $meta    Meta data. Used to set initial site options.
    12031203         */
    1204         do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
     1204        do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $network_id, $meta );
    12051205
    12061206        wp_cache_set( 'last_changed', microtime(), 'sites' );
    12071207