Ticket #40503: 40503.diff
File 40503.diff, 2.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/ms-functions.php
1138 1138 * @param string $title The new site's title. 1139 1139 * @param int $user_id The user ID of the new site's admin. 1140 1140 * @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. 1142 1142 * @return int|WP_Error Returns WP_Error object on failure, int $blog_id on success 1143 1143 */ 1144 function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $ site_id = 1 ) {1144 function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $network_id = 1 ) { 1145 1145 $defaults = array( 1146 1146 'public' => 0, 1147 'WPLANG' => get_ site_option('WPLANG' ),1147 'WPLANG' => get_network_option( $network_id, 'WPLANG' ), 1148 1148 ); 1149 1149 $meta = wp_parse_args( $meta, $defaults ); 1150 1150 … … 1160 1160 $path = '/'; 1161 1161 1162 1162 // 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) ) 1164 1164 return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) ); 1165 1165 1166 1166 if ( ! wp_installing() ) { 1167 1167 wp_installing( true ); 1168 1168 } 1169 1169 1170 if ( ! $blog_id = insert_blog($domain, $path, $ site_id) )1170 if ( ! $blog_id = insert_blog($domain, $path, $network_id) ) 1171 1171 return new WP_Error('insert_blog', __('Could not create site.')); 1172 1172 1173 1173 switch_to_blog($blog_id); … … 1198 1198 * @param int $user_id User ID. 1199 1199 * @param string $domain Site domain. 1200 1200 * @param string $path Site path. 1201 * @param int $ site_id SiteID. Only relevant on multi-network installs.1201 * @param int $network_id Network ID. Only relevant on multi-network installs. 1202 1202 * @param array $meta Meta data. Used to set initial site options. 1203 1203 */ 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 ); 1205 1205 1206 1206 wp_cache_set( 'last_changed', microtime(), 'sites' ); 1207 1207