Ticket #33528: 33528.diff
File 33528.diff, 2.7 KB (added by , 10 years ago) |
---|
-
src/wp-admin/network/site-new.php
10 10 /** Load WordPress Administration Bootstrap */ 11 11 require_once( dirname( __FILE__ ) . '/admin.php' ); 12 12 13 /** WordPress Translation Install API */ 14 require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); 15 13 16 if ( ! is_multisite() ) 14 17 wp_die( __( 'Multisite support is not enabled.' ) ); 15 18 … … 51 54 52 55 $title = $blog['title']; 53 56 57 $meta = array( 58 'public' => 1 59 ); 60 61 // Handle translation install for the new site. 62 if ( ! empty( $_POST['WPLANG'] ) && wp_can_install_language_pack() ) { // @todo: Skip if already installed 63 $language = wp_download_language_pack( $_POST['WPLANG'] ); 64 if ( $language ) { 65 $meta['WPLANG'] = wp_unslash( $language ); 66 } 67 } 68 54 69 if ( empty( $domain ) ) 55 70 wp_die( __( 'Missing or invalid site address.' ) ); 56 71 … … 83 98 } 84 99 85 100 $wpdb->hide_errors(); 86 $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );101 $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , $meta, $current_site->id ); 87 102 $wpdb->show_errors(); 88 103 if ( ! is_wp_error( $id ) ) { 89 104 if ( ! is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) { … … 155 170 <th scope="row"><label for="site-title"><?php _e( 'Site Title' ) ?></label></th> 156 171 <td><input name="blog[title]" type="text" class="regular-text" id="site-title" /></td> 157 172 </tr> 173 <?php 174 $languages = get_available_languages(); 175 $translations = wp_get_available_translations(); 176 if ( ! empty( $languages ) || ! empty( $translations ) ) : 177 ?> 178 <tr class="form-field form-required"> 179 <th scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th> 180 <td> 181 <?php 182 // Network default. 183 $lang = get_site_option( 'WPLANG' ); 184 185 // Use English if the default isn't available. 186 if ( ! in_array( $lang, $languages ) ) { 187 $lang = ''; 188 } 189 190 wp_dropdown_languages( array( 191 'name' => 'WPLANG', 192 'id' => 'WPLANG', 193 'selected' => $lang, 194 'languages' => $languages, 195 'translations' => $translations, 196 'show_available_translations' => wp_can_install_language_pack(), 197 ) ); 198 ?> 199 </td> 200 </tr> 201 <?php endif; // Languages. ?> 158 202 <tr class="form-field form-required"> 159 203 <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ) ?></label></th> 160 204 <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" /></td>