Ticket #33504: 33504.4.diff
File 33504.4.diff, 6.8 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/user.php
181 181 $user_id = wp_update_user( $user ); 182 182 } else { 183 183 $user_id = wp_insert_user( $user ); 184 $notify = ( ! isset( $_POST['send_reset_link'] ) ) ? 'admin' : 'both'; 185 184 186 /** 185 187 * Fires after a new user has been created. 186 188 * … … 187 189 * @since 4.4.0 188 190 * 189 191 * @param int $user_id ID of the newly created user. 192 * @param string $notify Email the user a password reset link. Defaults to 'both' which sends the email. To not send the email use $notify = 'admin'. 190 193 */ 191 do_action( 'edit_user_created_user', $user_id );194 do_action( 'edit_user_created_user', $user_id, $notify ); 192 195 } 193 196 return $user_id; 194 197 } -
wp-admin/network/site-new.php
101 101 * @since 4.4.0 102 102 * 103 103 * @param int $user_id ID of the newly created user. 104 * @param string $notify Email the user a password reset link. Defaults to 'both' which sends the email. To not send the email use $notify = 'admin'. 104 105 */ 105 do_action( 'network_site_new_created_user', $user_id );106 do_action( 'network_site_new_created_user', $user_id, $notify ); 106 107 } 107 108 108 109 $wpdb->hide_errors(); -
wp-admin/network/site-users.php
85 85 * @since 4.4.0 86 86 * 87 87 * @param int $user_id ID of the newly created user. 88 * @param string $notify Email the user a password reset link. Defaults to 'both' which sends the email. To not send the email use $notify = 'admin'. 88 89 */ 89 do_action( 'network_site_users_created_user', $user_id );90 do_action( 'network_site_users_created_user', $user_id, $notify ); 90 91 } 91 92 } 92 93 break; -
wp-admin/network/user-new.php
57 57 * @since 4.4.0 58 58 * 59 59 * @param int $user_id ID of the newly created user. 60 * @param int $notify Email the user a password reset link. Default is 'both' which sends the email. To not send the email use $notify = 'admin'. 60 61 */ 61 do_action( 'network_user_new_created_user', $user_id );62 do_action( 'network_user_new_created_user', $user_id, $notify ); 62 63 wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) ); 63 64 exit; 64 65 } -
wp-admin/user-new.php
368 368 $new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; 369 369 $new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : ''; 370 370 $new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : ''; 371 $ new_user_send_password = $creating && isset( $_POST['send_password'] ) ? wp_unslash( $_POST['send_password'] ): true;371 $send_reset_link = $creating && ! isset( $_POST['send_reset_link'] ) ? false : true; 372 372 $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : ''; 373 373 374 374 ?> … … 436 436 </label> 437 437 </td> 438 438 </tr> 439 <tr> 440 <th scope="row"><label for="send_reset_link"><?php _e('') ?></label></th> 441 <td> 442 <label for="send_reset_link"> 443 <input type="checkbox" name="send_reset_link" id="send_reset_link" value="both" <?php checked( $send_reset_link ); ?> /> 444 <?php _e('Send the new user a reset password link.'); ?> 445 </label> 446 </td> 447 </tr> 439 448 <?php } // !is_multisite ?> 440 449 <tr class="form-field"> 441 450 <th scope="row"><label for="role"><?php _e('Role'); ?></label></th> -
wp-includes/default-filters.php
343 343 add_action( 'comment_post', 'wp_new_comment_notify_moderator' ); 344 344 add_action( 'comment_post', 'wp_new_comment_notify_postauthor' ); 345 345 add_action( 'after_password_reset', 'wp_password_change_notification' ); 346 add_action( 'register_new_user', 'wp_send_new_user_notifications' );347 add_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );346 add_action( 'register_new_user', 'wp_send_new_user_notifications', 10, 2 ); 347 add_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 ); 348 348 349 349 /** 350 350 * Filters formerly mixed into wp-includes -
wp-includes/ms-default-filters.php
27 27 add_action( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 ); 28 28 add_action( 'wpmu_activate_user', 'wpmu_welcome_user_notification', 10, 3 ); 29 29 add_action( 'after_signup_user', 'wpmu_signup_user_notification', 10, 4 ); 30 add_action( 'network_site_new_created_user', 'wp_send_new_user_notifications' );31 add_action( 'network_site_users_created_user', 'wp_send_new_user_notifications' );32 add_action( 'network_user_new_created_user', 'wp_send_new_user_notifications' );30 add_action( 'network_site_new_created_user', 'wp_send_new_user_notifications', 10, 2 ); 31 add_action( 'network_site_users_created_user', 'wp_send_new_user_notifications', 10, 2 ); 32 add_action( 'network_user_new_created_user', 'wp_send_new_user_notifications', 10, 2 ); 33 33 add_filter( 'sanitize_user', 'strtolower' ); 34 34 35 35 // Blogs -
wp-includes/user-functions.php
2066 2066 * @since 4.4.0 2067 2067 * 2068 2068 * @param int $user_id ID of the newly registered user. 2069 * @param string $notify Email the user a password reset link. Defaults to 'both' which sends the email. To not send the email use $notify = 'admin'. 2069 2070 */ 2070 do_action( 'register_new_user', $user_id );2071 do_action( 'register_new_user', $user_id, $notify ); 2071 2072 2072 2073 return $user_id; 2073 2074 } … … 2081 2082 * 2082 2083 * @param int $user_id ID of the newly created user. 2083 2084 */ 2084 function wp_send_new_user_notifications( $user_id ) {2085 wp_new_user_notification( $user_id, null, 'both');2085 function wp_send_new_user_notifications( $user_id, $notify = 'both' ) { 2086 wp_new_user_notification( $user_id, null, $notify ); 2086 2087 } 2087 2088 2088 2089 /**