]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/user-new.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-admin / user-new.php
index 42732434a1566dd2936ac74f2de7989d13cd2a41..e039d711ef2598ff2128d9ed62096f019b53ee03 100644 (file)
@@ -87,6 +87,8 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
                         */
                        do_action( 'invite_user', $user_id, $role, $newuser_key );
 
+                       $switched_locale = switch_to_locale( get_user_locale( $user_details ) );
+
                        /* translators: 1: Site name, 2: site URL, 3: role, 4: activation URL */
                        $message = __( 'Hi,
 
@@ -96,6 +98,11 @@ You\'ve been invited to join \'%1$s\' at
 Please click the following link to confirm the invite:
 %4$s' );
                        wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
+
+                       if ( $switched_locale ) {
+                               restore_previous_locale();
+                       }
+
                        $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' );
                }
        }
@@ -203,8 +210,8 @@ get_current_screen()->add_help_tab( array(
 
 get_current_screen()->set_help_sidebar(
     '<p><strong>' . __('For more information:') . '</strong></p>' .
-    '<p>' . __('<a href="https://codex.wordpress.org/Users_Add_New_Screen" target="_blank">Documentation on Adding New Users</a>') . '</p>' .
-    '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+    '<p>' . __('<a href="https://codex.wordpress.org/Users_Add_New_Screen">Documentation on Adding New Users</a>') . '</p>' .
+    '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
 );
 
 wp_enqueue_script('wp-ajax-response');
@@ -270,9 +277,9 @@ if ( isset($_GET['update']) ) {
 <div class="wrap">
 <h1 id="add-new-user"><?php
 if ( current_user_can( 'create_users' ) ) {
-       echo _x( 'Add New User', 'user' );
+       _e( 'Add New User' );
 } elseif ( current_user_can( 'promote_users' ) ) {
-       echo _x( 'Add Existing User', 'user' );
+       _e( 'Add Existing User' );
 } ?>
 </h1>
 
@@ -341,8 +348,11 @@ if ( is_multisite() ) {
        </tr>
 <?php if ( current_user_can( 'manage_network_users' ) ) { ?>
        <tr>
-               <th scope="row"><label for="adduser-noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
-               <td><label for="adduser-noconfirmation"><input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" /> <?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label></td>
+               <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>
+               <td>
+                       <input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" />
+                       <label for="adduser-noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>
+               </td>
        </tr>
 <?php } ?>
 </table>
@@ -421,17 +431,17 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unsl
                </th>
                <td>
                        <input class="hidden" value=" " /><!-- #24364 workaround -->
-                       <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>
+                       <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>
                        <div class="wp-pwd hide-if-js">
                                <?php $initial_password = wp_generate_password( 24 ); ?>
                                <span class="password-input-wrapper">
                                        <input type="password" name="pass1" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
                                </span>
-                               <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
+                               <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
                                        <span class="dashicons dashicons-hidden"></span>
                                        <span class="text"><?php _e( 'Hide' ); ?></span>
                                </button>
-                               <button type="button" class="button button-secondary wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
+                               <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
                                        <span class="text"><?php _e( 'Cancel' ); ?></span>
                                </button>
                                <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
@@ -455,7 +465,10 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unsl
        </tr>
        <tr>
                <th scope="row"><?php _e( 'Send User Notification' ) ?></th>
-               <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>
+               <td>
+                       <input type="checkbox" name="send_user_notification" id="send_user_notification" value="1" <?php checked( $new_user_send_notification ); ?> />
+                       <label for="send_user_notification"><?php _e( 'Send the new user an email about their account.' ); ?></label>
+               </td>
        </tr>
 <?php } // !is_multisite ?>
        <tr class="form-field">
@@ -471,8 +484,11 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unsl
        </tr>
        <?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?>
        <tr>
-               <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
-               <td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> <?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label></td>
+               <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>
+               <td>
+                       <input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> />
+                       <label for="noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label>
+               </td>
        </tr>
        <?php } ?>
 </table>