WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/25/2015 10:37:35 PM (6 years ago)
Author:
ocean90
Message:

Users: Allow to create users without sending an email to the new user.

This adds a checkbox to wp-admin/user-new.php to prevent sending an email with the username and a password reset link to the new user. Restores the behavior of pre-4.3.

Fixes #33504.
Props tharsheblows, SergeyBiryukov, DrewAPicture, ocean90.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-new.php

    r34582 r35742  
    369369$new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : '';
    370370$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;
    372372$new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : '';
    373373
     
    419419                <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
    420420            </div>
    421             <p><span class="description"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></span></p>
    422421        </td>
    423422    </tr>
     
    436435            </label>
    437436        </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>
    438441    </tr>
    439442<?php } // !is_multisite ?>
Note: See TracChangeset for help on using the changeset viewer.