diff --git wp-admin/includes/upgrade.php wp-admin/includes/upgrade.php
index 5d2e3fc..3daf80e 100644
|
|
function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated |
89 | 89 | /** |
90 | 90 | * Fires after a site is fully installed. |
91 | 91 | * |
| 92 | * Note: this hook only ever fires once when WP itself is being installed. |
| 93 | * It is never fired afterwards. |
| 94 | * |
| 95 | * To customize new sites on WP multisite installations, use either of: |
| 96 | * |
| 97 | * - wp_install_defaults |
| 98 | * - wpmu_new_blog |
| 99 | * |
92 | 100 | * @since 3.9.0 |
93 | 101 | * |
94 | 102 | * @param WP_User $user The site owner. |
… |
… |
if ( !function_exists('wp_install_defaults') ) : |
112 | 120 | function wp_install_defaults( $user_id ) { |
113 | 121 | global $wpdb, $wp_rewrite, $table_prefix; |
114 | 122 | |
| 123 | $user = new WP_User($user_id); |
| 124 | |
115 | 125 | // Default category |
116 | 126 | $cat_name = __('Uncategorized'); |
117 | 127 | /* translators: Default category slug */ |
… |
… |
As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d |
239 | 249 | $wp_rewrite->init(); |
240 | 250 | $wp_rewrite->flush_rules(); |
241 | 251 | |
242 | | $user = new WP_User($user_id); |
243 | 252 | $wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') ); |
244 | 253 | |
245 | 254 | // Remove all perms except for the login user. |
… |
… |
As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d |
250 | 259 | if ( !is_super_admin( $user_id ) && $user_id != 1 ) |
251 | 260 | $wpdb->delete( $wpdb->usermeta, array( 'user_id' => $user_id , 'meta_key' => $wpdb->base_prefix.'1_capabilities' ) ); |
252 | 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Fires after a site's defaults are fully set. |
| 265 | * |
| 266 | * Note: this hook fires once when WP itself is being installed, and once per |
| 267 | * additional site on multisite installations. In both cases, it is fired in |
| 268 | * the context of the newly installed site. |
| 269 | * |
| 270 | * For multisite installations, see also the wpmu_new_blog hook, which is |
| 271 | * fired at the very end of wpmu_create_blog() in the context of wherever |
| 272 | * the new site got installed. |
| 273 | * |
| 274 | * Note 2: the user is marked as an administrator when the hook fires on a |
| 275 | * single site install; this is not the case on a multisite install. |
| 276 | * |
| 277 | * @since 3.9.0 |
| 278 | * |
| 279 | * @param WP_User $user The site owner. |
| 280 | */ |
| 281 | do_action( 'wp_install_defaults', $user ); |
253 | 282 | } |
254 | 283 | endif; |
255 | 284 | |
… |
… |
if ( !function_exists('wp_new_blog_notification') ) : |
268 | 297 | */ |
269 | 298 | function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { |
270 | 299 | $user = new WP_User( $user_id ); |
271 | | $email = $user->user_email; |
272 | 300 | $name = $user->user_login; |
| 301 | |
| 302 | $subject = __( 'New WordPress Site' ); |
| 303 | $email = $user->user_email; |
| 304 | |
273 | 305 | $message = sprintf(__("Your new WordPress site has been successfully set up at: |
274 | 306 | |
275 | 307 | %1\$s |
… |
… |
We hope you enjoy your new site. Thanks! |
285 | 317 | http://wordpress.org/ |
286 | 318 | "), $blog_url, $name, $password); |
287 | 319 | |
288 | | @wp_mail($email, __('New WordPress Site'), $message); |
| 320 | /** |
| 321 | * Fires before sending a new blog notification by email to that blog's admin. |
| 322 | * |
| 323 | * To override the email, or cancel it altogether, apply your custom logic |
| 324 | * and return false. |
| 325 | * |
| 326 | * @since 3.9.0 |
| 327 | * |
| 328 | * @param boolean $send return false to prevent WP from sending an email. |
| 329 | * @param string $blog_url Blog url. |
| 330 | * @param int $user_id User ID. |
| 331 | * @param string $password User's Password. |
| 332 | */ |
| 333 | if ( apply_filters( 'wp_new_blog_notification', true, $blog_title, $blog_url, $user_id, $password ) ) { |
| 334 | WP_DEBUG ? wp_mail( $email, $subject, $message ) : @wp_mail( $email, $subject, $message ); |
| 335 | } |
289 | 336 | } |
290 | 337 | endif; |
291 | 338 | |
diff --git wp-includes/ms-functions.php wp-includes/ms-functions.php
index b7b4b6a..6474fa6 100644
|
|
function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s |
1172 | 1172 | /** |
1173 | 1173 | * Fires immediately after a new site is created. |
1174 | 1174 | * |
| 1175 | * See also the wp_install_defaults hook, which fires before the current |
| 1176 | * blog's context is restored. |
| 1177 | * |
1175 | 1178 | * @since MU |
1176 | 1179 | * |
1177 | 1180 | * @param int $blog_id Blog ID. |