diff --git src/wp-admin/includes/user.php src/wp-admin/includes/user.php
index 3348e43..132ea6d 100644
|
|
function edit_user( $user_id = 0 ) { |
176 | 176 | $user_id = wp_update_user( $user ); |
177 | 177 | } else { |
178 | 178 | $user_id = wp_insert_user( $user ); |
179 | | wp_new_user_notification( $user_id ); |
| 179 | wp_new_user_notification( $user_id, 'both' ); |
180 | 180 | } |
181 | 181 | return $user_id; |
182 | 182 | } |
diff --git src/wp-admin/network/site-new.php src/wp-admin/network/site-new.php
index cf36617..8dec36c 100644
|
|
if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { |
79 | 79 | if ( false === $user_id ) |
80 | 80 | wp_die( __( 'There was an error creating the user.' ) ); |
81 | 81 | else |
82 | | wp_new_user_notification( $user_id, $password ); |
| 82 | wp_new_user_notification( $user_id, 'both' ); |
83 | 83 | } |
84 | 84 | |
85 | 85 | $wpdb->hide_errors(); |
diff --git src/wp-admin/network/site-users.php src/wp-admin/network/site-users.php
index 0fcead5..0ab1771 100644
|
|
if ( $action ) { |
77 | 77 | if ( false === $user_id ) { |
78 | 78 | $update = 'err_new_dup'; |
79 | 79 | } else { |
80 | | wp_new_user_notification( $user_id, $password ); |
| 80 | wp_new_user_notification( $user_id, 'both' ); |
81 | 81 | add_user_to_blog( $id, $user_id, $_POST['new_role'] ); |
82 | 82 | $update = 'newuser'; |
83 | 83 | } |
diff --git src/wp-admin/network/user-new.php src/wp-admin/network/user-new.php
index ba89697..002e098 100644
|
|
if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) { |
51 | 51 | if ( ! $user_id ) { |
52 | 52 | $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) ); |
53 | 53 | } else { |
54 | | wp_new_user_notification( $user_id, $password ); |
| 54 | wp_new_user_notification( $user_id, 'both' ); |
55 | 55 | wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) ); |
56 | 56 | exit; |
57 | 57 | } |
diff --git src/wp-includes/pluggable.php src/wp-includes/pluggable.php
index 655fc55..dae968e 100644
|
|
if ( !function_exists('wp_new_user_notification') ) : |
1689 | 1689 | * |
1690 | 1690 | * @since 2.0.0 |
1691 | 1691 | * |
1692 | | * @param int $user_id User ID. |
| 1692 | * @param int $user_id User ID. |
| 1693 | * @param string $notify Whether admin and user should be notified ('both') or |
| 1694 | * only the admin ('admin' or empty). |
1693 | 1695 | */ |
1694 | | function wp_new_user_notification($user_id) { |
| 1696 | function wp_new_user_notification( $user_id, $notify = '' ) { |
1695 | 1697 | global $wpdb; |
1696 | 1698 | $user = get_userdata( $user_id ); |
1697 | 1699 | |
… |
… |
function wp_new_user_notification($user_id) { |
1705 | 1707 | |
1706 | 1708 | @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); |
1707 | 1709 | |
| 1710 | if ( 'admin' === $notify || empty( $notify ) ) { |
| 1711 | return; |
| 1712 | } |
| 1713 | |
1708 | 1714 | // Generate something random for a password reset key. |
1709 | 1715 | $key = wp_generate_password( 20, false ); |
1710 | 1716 | |
| 1717 | /** This action is documented in wp-login.php */ |
1711 | 1718 | do_action( 'retrieve_password_key', $user->user_login, $key ); |
1712 | 1719 | |
1713 | 1720 | // Now insert the key, hashed, into the DB. |
diff --git src/wp-includes/user.php src/wp-includes/user.php
index 54b09ff..1cd2db2 100644
|
|
function register_new_user( $user_login, $user_email ) { |
2619 | 2619 | |
2620 | 2620 | update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. |
2621 | 2621 | |
2622 | | wp_new_user_notification( $user_id ); |
| 2622 | wp_new_user_notification( $user_id, 'both' ); |
2623 | 2623 | |
2624 | 2624 | return $user_id; |
2625 | 2625 | } |