Ticket #20793: 20793.4.diff
| File 20793.4.diff, 1.6 KB (added by , 13 years ago) |
|---|
-
src/wp-includes/ms-functions.php
936 936 * @param int $site_id Optional. Only relevant on multi-network installs. 937 937 * @return mixed Returns WP_Error object on failure, int $blog_id on success 938 938 */ 939 function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = '', $site_id = 1) {939 function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = '', $site_id = 1 ) { 940 940 $domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) ); 941 941 942 942 if ( is_subdomain_install() ) … … 964 964 965 965 add_user_to_blog($blog_id, $user_id, 'administrator'); 966 966 967 if ( is_array($meta) ) foreach ($meta as $key => $value) {968 if ( $key == 'public' || $key == 'archived' || $key == 'mature' || $key == 'spam' || $key == 'deleted' || $key == 'lang_id')967 foreach ( (array) $meta as $key => $value ) { 968 if ( in_array( $key, array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ) ) ) 969 969 update_blog_status( $blog_id, $key, $value ); 970 970 else 971 971 update_option( $key, $value ); … … 972 972 } 973 973 974 974 add_option( 'WPLANG', get_site_option( 'WPLANG' ) ); 975 update_option( 'blog_public', (int)$meta['public'] );976 975 976 if ( ! $meta ) 977 $meta = array( 'public' => 0 ); 978 979 update_option( 'blog_public', (int) $meta['public'] ); 980 977 981 if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) ) 978 982 update_user_meta( $user_id, 'primary_blog', $blog_id ); 979 983