143 if ( ! is_wp_error( $id ) ) { |
143 if ( ! is_wp_error( $id ) ) { |
144 if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) { |
144 if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) { |
145 update_user_option( $user_id, 'primary_blog', $id, true ); |
145 update_user_option( $user_id, 'primary_blog', $id, true ); |
146 } |
146 } |
147 |
147 |
148 wp_mail( |
148 wpmu_new_site_admin_notification( $id, $user_id ); |
149 get_site_option( 'admin_email' ), |
|
150 sprintf( |
|
151 /* translators: New site notification email subject. %s: Network title. */ |
|
152 __( '[%s] New Site Created' ), |
|
153 get_network()->site_name |
|
154 ), |
|
155 sprintf( |
|
156 /* translators: New site notification email. 1: User login, 2: Site URL, 3: Site title. */ |
|
157 __( |
|
158 'New site created by %1$s |
|
159 |
|
160 Address: %2$s |
|
161 Name: %3$s' |
|
162 ), |
|
163 $current_user->user_login, |
|
164 get_site_url( $id ), |
|
165 wp_unslash( $title ) |
|
166 ), |
|
167 sprintf( |
|
168 'From: "%1$s" <%2$s>', |
|
169 _x( 'Site Admin', 'email "From" field' ), |
|
170 get_site_option( 'admin_email' ) |
|
171 ) |
|
172 ); |
|
173 wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); |
149 wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); |
174 wp_redirect( |
150 wp_redirect( |
175 add_query_arg( |
151 add_query_arg( |
176 array( |
152 array( |
177 'update' => 'added', |
153 'update' => 'added', |
223 __( 'Required fields are marked %s' ), |
199 __( 'Required fields are marked %s' ), |
224 '<span class="required">*</span>' |
200 '<span class="required">*</span>' |
225 ); |
201 ); |
226 ?> |
202 ?> |
227 </p> |
203 </p> |
228 <form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate"> |
204 <form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate"> |
229 <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?> |
205 <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?> |
230 <table class="form-table" role="presentation"> |
206 <table class="form-table" role="presentation"> |
231 <tr class="form-field form-required"> |
207 <tr class="form-field form-required"> |
232 <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th> |
208 <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th> |
233 <td> |
209 <td> |