Changeset 35742
- Timestamp:
- 11/25/2015 10:37:35 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r35725 r35742 177 177 } else { 178 178 $user_id = wp_insert_user( $user ); 179 $notify = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin'; 180 179 181 /** 180 182 * Fires after a new user has been created. … … 182 184 * @since 4.4.0 183 185 * 184 * @param int $user_id ID of the newly created user. 186 * @param int $user_id ID of the newly created user. 187 * @param string $notify Type of notification that should happen. See {@see wp_send_new_user_notifications()} 188 * for more information on possible values. 185 189 */ 186 do_action( 'edit_user_created_user', $user_id );190 do_action( 'edit_user_created_user', $user_id, $notify ); 187 191 } 188 192 return $user_id; -
trunk/src/wp-admin/user-new.php
r34582 r35742 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 $new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true; 372 372 $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : ''; 373 373 … … 419 419 <div style="display:none" id="pass-strength-result" aria-live="polite"></div> 420 420 </div> 421 <p><span class="description"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></span></p>422 421 </td> 423 422 </tr> … … 436 435 </label> 437 436 </td> 437 </tr> 438 <tr> 439 <th scope="row"><?php _e( 'Send User Notification' ) ?></th> 440 <td><label for="send_user_notification"><input type="checkbox" name="send_user_notification" id="send_user_notification" value="1" <?php checked( $new_user_send_notification ); ?> /> <?php _e( 'Send the new user an email about their account.' ); ?></label></td> 438 441 </tr> 439 442 <?php } // !is_multisite ?> -
trunk/src/wp-includes/default-filters.php
r35709 r35742 358 358 add_action( 'after_password_reset', 'wp_password_change_notification' ); 359 359 add_action( 'register_new_user', 'wp_send_new_user_notifications' ); 360 add_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );360 add_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 ); 361 361 362 362 // REST API actions. -
trunk/src/wp-includes/user.php
r35725 r35742 2199 2199 * @since 4.4.0 2200 2200 * 2201 * @param int $user_id ID of the newly created user. 2202 */ 2203 function wp_send_new_user_notifications( $user_id ) { 2204 wp_new_user_notification( $user_id, null, 'both' ); 2201 * @param int $user_id ID of the newly created user. 2202 * @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty string 2203 * (admin only), or 'both' (admin and user). Default 'both'. 2204 */ 2205 function wp_send_new_user_notifications( $user_id, $notify = 'both' ) { 2206 wp_new_user_notification( $user_id, null, $notify ); 2205 2207 } 2206 2208
Note: See TracChangeset
for help on using the changeset viewer.