diff --git wp-admin/includes/upgrade.php wp-admin/includes/upgrade.php
index 5d2e3fc..36896a4 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 | | * @param WP_User $user The site owner. |
| 102 | * @param int $user_id The site owner's id. |
95 | 103 | */ |
96 | | do_action( 'wp_install', $user ); |
| 104 | do_action( 'wp_install', $user_id ); |
97 | 105 | |
98 | 106 | return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message); |
99 | 107 | } |
… |
… |
As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d |
250 | 258 | if ( !is_super_admin( $user_id ) && $user_id != 1 ) |
251 | 259 | $wpdb->delete( $wpdb->usermeta, array( 'user_id' => $user_id , 'meta_key' => $wpdb->base_prefix.'1_capabilities' ) ); |
252 | 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Fires after a site's defaults are fully installed. |
| 264 | * |
| 265 | * Note: this hook fires once when WP itself is being installed, and once per |
| 266 | * additional sites on multisite installations. In both cases, it is fired in |
| 267 | * the context of the newly installed site. |
| 268 | * |
| 269 | * For multisite installations, see also the wpmu_new_blog hook, which is |
| 270 | * fired at the very end of wpmu_create_blog() in the context of wherever |
| 271 | * the new site got installed. |
| 272 | * |
| 273 | * Note 2: the user is marked as an administrator when the hook fires on a |
| 274 | * single site install; this is not the case on a multisite install. |
| 275 | * |
| 276 | * @since 3.9.0 |
| 277 | * |
| 278 | * @param int $user_id The site owner's id. |
| 279 | */ |
| 280 | do_action( 'wp_install_defaults', $user_id ); |
253 | 281 | } |
254 | 282 | endif; |
255 | 283 | |
… |
… |
if ( !function_exists('wp_new_blog_notification') ) : |
267 | 295 | * @param string $password User's Password. |
268 | 296 | */ |
269 | 297 | function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { |
| 298 | $context = compact('blog_title', 'blog_url', 'user_id', 'password'); |
| 299 | |
270 | 300 | $user = new WP_User( $user_id ); |
271 | | $email = $user->user_email; |
272 | 301 | $name = $user->user_login; |
| 302 | |
| 303 | $subject = __('New WordPress Site'); |
| 304 | $email = $user->user_email; |
| 305 | |
273 | 306 | $message = sprintf(__("Your new WordPress site has been successfully set up at: |
274 | 307 | |
275 | 308 | %1\$s |
… |
… |
We hope you enjoy your new site. Thanks! |
285 | 318 | http://wordpress.org/ |
286 | 319 | "), $blog_url, $name, $password); |
287 | 320 | |
288 | | @wp_mail($email, __('New WordPress Site'), $message); |
| 321 | /** |
| 322 | * Fires before sending a new blog notification by email to that blog's admin. |
| 323 | * |
| 324 | * To override the email, or cancel it altogether, apply your custom logic |
| 325 | * and return false. |
| 326 | * |
| 327 | * @since 3.9.0 |
| 328 | * |
| 329 | * @param boolean $send return false to prevent WP from sending an email |
| 330 | * @param array $context the arguments passed to wp_new_blog_notification() |
| 331 | */ |
| 332 | if (apply_filters('wp_new_blog_notification', true, $context)) { |
| 333 | WP_DEBUG ? wp_mail($email, $subject, $message) : @wp_mail($email, $subject, $message); |
| 334 | } |
289 | 335 | } |
290 | 336 | endif; |
291 | 337 | |
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. |
diff --git wp-includes/pluggable.php wp-includes/pluggable.php
index 794565f..c75dfa7 100644
|
|
if ( !function_exists('wp_new_user_notification') ) : |
1281 | 1281 | * @param string $plaintext_pass Optional. The user's plaintext password |
1282 | 1282 | */ |
1283 | 1283 | function wp_new_user_notification($user_id, $plaintext_pass = '') { |
| 1284 | $context = compact('user_id', 'plaintext_pass'); |
| 1285 | |
1284 | 1286 | $user = get_userdata( $user_id ); |
1285 | 1287 | |
1286 | 1288 | // The blogname option is escaped with esc_html on the way into the database in sanitize_option |
1287 | 1289 | // we want to reverse this for the plain text arena of emails. |
1288 | 1290 | $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); |
1289 | 1291 | |
| 1292 | $subject = sprintf(__('[%s] New User Registration', $blogname)); |
| 1293 | $email = get_option('admin_email'); |
| 1294 | |
1290 | 1295 | $message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n"; |
1291 | 1296 | $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n"; |
1292 | 1297 | $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n"; |
1293 | 1298 | |
1294 | | @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); |
| 1299 | /** |
| 1300 | * Fires before sending a new user notification by email to that blog's admin. |
| 1301 | * |
| 1302 | * To override the email, or cancel it altogether, apply your custom logic |
| 1303 | * and return false. |
| 1304 | * |
| 1305 | * @since 3.9.0 |
| 1306 | * |
| 1307 | * @param boolean $send return false to prevent WP from sending an email |
| 1308 | * @param array $context the arguments passed to wp_new_user_notification() |
| 1309 | */ |
| 1310 | if (apply_filters('wp_new_user_notification_admin', true, $context)) { |
| 1311 | WP_DEBUG ? wp_mail($email, $subject, $message) : @wp_mail($email, $subject, $message); |
| 1312 | } |
1295 | 1313 | |
1296 | 1314 | if ( empty($plaintext_pass) ) |
1297 | 1315 | return; |
1298 | 1316 | |
| 1317 | $subject = sprintf(__('[%s] Your username and password'), $blogname); |
| 1318 | $email = $user->user_email; |
| 1319 | |
1299 | 1320 | $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n"; |
1300 | 1321 | $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; |
1301 | 1322 | $message .= wp_login_url() . "\r\n"; |
1302 | 1323 | |
1303 | | wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message); |
1304 | | |
| 1324 | /** |
| 1325 | * Fires before sending a new user notification by email to that new user. |
| 1326 | * |
| 1327 | * To override the email, or cancel it altogether, apply your custom logic |
| 1328 | * and return false. |
| 1329 | * |
| 1330 | * @since 3.9.0 |
| 1331 | * |
| 1332 | * @param boolean $send return false to prevent WP from sending an email |
| 1333 | * @param array $context the arguments passed to wp_new_user_notification() |
| 1334 | */ |
| 1335 | if (apply_filters('wp_new_user_notification_user', true, $context)) { |
| 1336 | WP_DEBUG ? wp_mail($email, $subject, $message) : @wp_mail($email, $subject, $message); |
| 1337 | } |
1305 | 1338 | } |
1306 | 1339 | endif; |
1307 | 1340 | |