author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 18:28:13 +0200 | |
changeset 9 | 177826044cd9 |
parent 7 | cf61fcea0001 |
child 16 | a86126ab1dd4 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* New User Administration Screen. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** WordPress Administration Bootstrap */ |
|
10 |
require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
11 |
||
12 |
if ( is_multisite() ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
13 |
if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
14 |
wp_die( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
17 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
18 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
19 |
} |
0 | 20 |
} elseif ( ! current_user_can( 'create_users' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
21 |
wp_die( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
22 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
23 |
'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
24 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
25 |
); |
0 | 26 |
} |
27 |
||
28 |
if ( is_multisite() ) { |
|
29 |
add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' ); |
|
30 |
} |
|
31 |
||
9 | 32 |
if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) { |
0 | 33 |
check_admin_referer( 'add-user', '_wpnonce_add-user' ); |
34 |
||
35 |
$user_details = null; |
|
9 | 36 |
$user_email = wp_unslash( $_REQUEST['email'] ); |
5 | 37 |
if ( false !== strpos( $user_email, '@' ) ) { |
38 |
$user_details = get_user_by( 'email', $user_email ); |
|
0 | 39 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
40 |
if ( current_user_can( 'manage_network_users' ) ) { |
5 | 41 |
$user_details = get_user_by( 'login', $user_email ); |
0 | 42 |
} else { |
9 | 43 |
wp_redirect( add_query_arg( array( 'update' => 'enter_email' ), 'user-new.php' ) ); |
0 | 44 |
die(); |
45 |
} |
|
46 |
} |
|
47 |
||
9 | 48 |
if ( ! $user_details ) { |
49 |
wp_redirect( add_query_arg( array( 'update' => 'does_not_exist' ), 'user-new.php' ) ); |
|
0 | 50 |
die(); |
51 |
} |
|
52 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
53 |
if ( ! current_user_can( 'promote_user', $user_details->ID ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
54 |
wp_die( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
55 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
56 |
'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
57 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
} |
0 | 60 |
|
61 |
// Adding an existing user to this blog |
|
62 |
$new_user_email = $user_details->user_email; |
|
9 | 63 |
$redirect = 'user-new.php'; |
64 |
$username = $user_details->user_login; |
|
65 |
$user_id = $user_details->ID; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
66 |
if ( $username != null && array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) { |
9 | 67 |
$redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' ); |
0 | 68 |
} else { |
9 | 69 |
if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { |
70 |
$result = add_existing_user_to_blog( |
|
71 |
array( |
|
72 |
'user_id' => $user_id, |
|
73 |
'role' => $_REQUEST['role'], |
|
74 |
) |
|
75 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
76 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
77 |
if ( ! is_wp_error( $result ) ) { |
9 | 78 |
$redirect = add_query_arg( |
79 |
array( |
|
80 |
'update' => 'addnoconfirmation', |
|
81 |
'user_id' => $user_id, |
|
82 |
), |
|
83 |
'user-new.php' |
|
84 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
85 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
86 |
$redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
87 |
} |
0 | 88 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
89 |
$newuser_key = wp_generate_password( 20, false ); |
9 | 90 |
add_option( |
91 |
'new_user_' . $newuser_key, |
|
92 |
array( |
|
93 |
'user_id' => $user_id, |
|
94 |
'email' => $user_details->user_email, |
|
95 |
'role' => $_REQUEST['role'], |
|
96 |
) |
|
97 |
); |
|
0 | 98 |
|
99 |
$roles = get_editable_roles(); |
|
9 | 100 |
$role = $roles[ $_REQUEST['role'] ]; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
101 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
102 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
103 |
* Fires immediately after a user is invited to join a site, but before the notification is sent. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
104 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
105 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
106 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
107 |
* @param int $user_id The invited user's ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
108 |
* @param array $role The role of invited user. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
109 |
* @param string $newuser_key The key of the invitation. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
110 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
111 |
do_action( 'invite_user', $user_id, $role, $newuser_key ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
112 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
113 |
$switched_locale = switch_to_locale( get_user_locale( $user_details ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
114 |
|
0 | 115 |
/* translators: 1: Site name, 2: site URL, 3: role, 4: activation URL */ |
9 | 116 |
$message = __( |
117 |
'Hi, |
|
0 | 118 |
|
119 |
You\'ve been invited to join \'%1$s\' at |
|
120 |
%2$s with the role of %3$s. |
|
121 |
||
122 |
Please click the following link to confirm the invite: |
|
9 | 123 |
%4$s' |
124 |
); |
|
125 |
||
126 |
/* translators: Joining confirmation notification email subject. %s: Site title */ |
|
127 |
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/" ) ) ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
128 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
129 |
if ( $switched_locale ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
130 |
restore_previous_locale(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
131 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
132 |
|
9 | 133 |
$redirect = add_query_arg( array( 'update' => 'add' ), 'user-new.php' ); |
0 | 134 |
} |
135 |
} |
|
136 |
wp_redirect( $redirect ); |
|
137 |
die(); |
|
9 | 138 |
} elseif ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ) { |
0 | 139 |
check_admin_referer( 'create-user', '_wpnonce_create-user' ); |
140 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
141 |
if ( ! current_user_can( 'create_users' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
142 |
wp_die( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
143 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
144 |
'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
145 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
146 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
147 |
} |
0 | 148 |
|
149 |
if ( ! is_multisite() ) { |
|
150 |
$user_id = edit_user(); |
|
151 |
||
152 |
if ( is_wp_error( $user_id ) ) { |
|
153 |
$add_user_errors = $user_id; |
|
154 |
} else { |
|
9 | 155 |
if ( current_user_can( 'list_users' ) ) { |
0 | 156 |
$redirect = 'users.php?update=add&id=' . $user_id; |
9 | 157 |
} else { |
0 | 158 |
$redirect = add_query_arg( 'update', 'add', 'user-new.php' ); |
9 | 159 |
} |
0 | 160 |
wp_redirect( $redirect ); |
161 |
die(); |
|
162 |
} |
|
163 |
} else { |
|
164 |
// Adding a new user to this site |
|
5 | 165 |
$new_user_email = wp_unslash( $_REQUEST['email'] ); |
9 | 166 |
$user_details = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email ); |
167 |
if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) { |
|
168 |
$add_user_errors = $user_details['errors']; |
|
0 | 169 |
} else { |
9 | 170 |
/** This filter is documented in wp-includes/user.php */ |
0 | 171 |
$new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) ); |
9 | 172 |
if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { |
0 | 173 |
add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email |
5 | 174 |
add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email |
0 | 175 |
} |
9 | 176 |
wpmu_signup_user( |
177 |
$new_user_login, |
|
178 |
$new_user_email, |
|
179 |
array( |
|
180 |
'add_to_blog' => get_current_blog_id(), |
|
181 |
'new_role' => $_REQUEST['role'], |
|
182 |
) |
|
183 |
); |
|
184 |
if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { |
|
185 |
$key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
186 |
$new_user = wpmu_activate_signup( $key ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
187 |
if ( is_wp_error( $new_user ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
188 |
$redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
189 |
} elseif ( ! is_user_member_of_blog( $new_user['user_id'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
190 |
$redirect = add_query_arg( array( 'update' => 'created_could_not_add' ), 'user-new.php' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
} else { |
9 | 192 |
$redirect = add_query_arg( |
193 |
array( |
|
194 |
'update' => 'addnoconfirmation', |
|
195 |
'user_id' => $new_user['user_id'], |
|
196 |
), |
|
197 |
'user-new.php' |
|
198 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
199 |
} |
0 | 200 |
} else { |
9 | 201 |
$redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' ); |
0 | 202 |
} |
203 |
wp_redirect( $redirect ); |
|
204 |
die(); |
|
205 |
} |
|
206 |
} |
|
207 |
} |
|
208 |
||
9 | 209 |
$title = __( 'Add New User' ); |
0 | 210 |
$parent_file = 'users.php'; |
211 |
||
212 |
$do_both = false; |
|
9 | 213 |
if ( is_multisite() && current_user_can( 'promote_users' ) && current_user_can( 'create_users' ) ) { |
0 | 214 |
$do_both = true; |
9 | 215 |
} |
0 | 216 |
|
9 | 217 |
$help = '<p>' . __( 'To add a new user to your site, fill in the form on this screen and click the Add New User button at the bottom.' ) . '</p>'; |
0 | 218 |
|
219 |
if ( is_multisite() ) { |
|
9 | 220 |
$help .= '<p>' . __( 'Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user’s name to Edit the user profile under Network Admin > All Users.' ) . '</p>' . |
221 |
'<p>' . __( 'New users will receive an email letting them know they’ve been added as a user for your site. This email will also contain their password. Check the box if you don’t want the user to receive a welcome email.' ) . '</p>'; |
|
0 | 222 |
} else { |
9 | 223 |
$help .= '<p>' . __( 'New users are automatically assigned a password, which they can change after logging in. You can view or edit the assigned password by clicking the Show Password button. The username cannot be changed once the user has been added.' ) . '</p>' . |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
224 |
|
9 | 225 |
'<p>' . __( 'By default, new users will receive an email letting them know they’ve been added as a user for your site. This email will also contain a password reset link. Uncheck the box if you don’t want to send the new user a welcome email.' ) . '</p>'; |
0 | 226 |
} |
227 |
||
9 | 228 |
$help .= '<p>' . __( 'Remember to click the Add New User button at the bottom of this screen when you are finished.' ) . '</p>'; |
0 | 229 |
|
9 | 230 |
get_current_screen()->add_help_tab( |
231 |
array( |
|
232 |
'id' => 'overview', |
|
233 |
'title' => __( 'Overview' ), |
|
234 |
'content' => $help, |
|
235 |
) |
|
236 |
); |
|
0 | 237 |
|
9 | 238 |
get_current_screen()->add_help_tab( |
239 |
array( |
|
240 |
'id' => 'user-roles', |
|
241 |
'title' => __( 'User Roles' ), |
|
242 |
'content' => '<p>' . __( 'Here is a basic overview of the different user roles and the permissions associated with each one:' ) . '</p>' . |
|
243 |
'<ul>' . |
|
244 |
'<li>' . __( 'Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.' ) . '</li>' . |
|
245 |
'<li>' . __( 'Contributors can write and manage their posts but not publish posts or upload media files.' ) . '</li>' . |
|
246 |
'<li>' . __( 'Authors can publish and manage their own posts, and are able to upload files.' ) . '</li>' . |
|
247 |
'<li>' . __( 'Editors can publish posts, manage posts as well as manage other people’s posts, etc.' ) . '</li>' . |
|
248 |
'<li>' . __( 'Administrators have access to all the administration features.' ) . '</li>' . |
|
249 |
'</ul>', |
|
250 |
) |
|
251 |
); |
|
0 | 252 |
|
253 |
get_current_screen()->set_help_sidebar( |
|
9 | 254 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
255 |
'<p>' . __( '<a href="https://codex.wordpress.org/Users_Add_New_Screen">Documentation on Adding New Users</a>' ) . '</p>' . |
|
256 |
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
|
0 | 257 |
); |
258 |
||
9 | 259 |
wp_enqueue_script( 'wp-ajax-response' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
260 |
wp_enqueue_script( 'user-profile' ); |
0 | 261 |
|
262 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
263 |
* Filters whether to enable user auto-complete for non-super admins in Multisite. |
0 | 264 |
* |
265 |
* @since 3.4.0 |
|
266 |
* |
|
5 | 267 |
* @param bool $enable Whether to enable auto-complete for non-super admins. Default false. |
0 | 268 |
*/ |
269 |
if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
270 |
&& ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) ) |
0 | 271 |
) { |
272 |
wp_enqueue_script( 'user-suggest' ); |
|
273 |
} |
|
274 |
||
275 |
require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
276 |
||
9 | 277 |
if ( isset( $_GET['update'] ) ) { |
0 | 278 |
$messages = array(); |
279 |
if ( is_multisite() ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
280 |
$edit_link = ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
281 |
if ( ( isset( $_GET['user_id'] ) ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
282 |
$user_id_new = absint( $_GET['user_id'] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
283 |
if ( $user_id_new ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
284 |
$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
285 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
286 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
287 |
|
0 | 288 |
switch ( $_GET['update'] ) { |
9 | 289 |
case 'newuserconfirmation': |
290 |
$messages[] = __( 'Invitation email sent to new user. A confirmation link must be clicked before their account is created.' ); |
|
0 | 291 |
break; |
9 | 292 |
case 'add': |
293 |
$messages[] = __( 'Invitation email sent to user. A confirmation link must be clicked for them to be added to your site.' ); |
|
0 | 294 |
break; |
9 | 295 |
case 'addnoconfirmation': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
296 |
if ( empty( $edit_link ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
297 |
$messages[] = __( 'User has been added to your site.' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
298 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
299 |
/* translators: %s: edit page url */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
300 |
$messages[] = sprintf( __( 'User has been added to your site. <a href="%s">Edit user</a>' ), $edit_link ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
301 |
} |
0 | 302 |
break; |
9 | 303 |
case 'addexisting': |
304 |
$messages[] = __( 'That user is already a member of this site.' ); |
|
0 | 305 |
break; |
9 | 306 |
case 'could_not_add': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
307 |
$add_user_errors = new WP_Error( 'could_not_add', __( 'That user could not be added to this site.' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
308 |
break; |
9 | 309 |
case 'created_could_not_add': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
310 |
$add_user_errors = new WP_Error( 'created_could_not_add', __( 'User has been created, but could not be added to this site.' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
311 |
break; |
9 | 312 |
case 'does_not_exist': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
313 |
$add_user_errors = new WP_Error( 'does_not_exist', __( 'The requested user does not exist.' ) ); |
0 | 314 |
break; |
9 | 315 |
case 'enter_email': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
316 |
$add_user_errors = new WP_Error( 'enter_email', __( 'Please enter a valid email address.' ) ); |
0 | 317 |
break; |
318 |
} |
|
319 |
} else { |
|
9 | 320 |
if ( 'add' == $_GET['update'] ) { |
321 |
$messages[] = __( 'User added.' ); |
|
322 |
} |
|
0 | 323 |
} |
324 |
} |
|
325 |
?> |
|
326 |
<div class="wrap"> |
|
9 | 327 |
<h1 id="add-new-user"> |
328 |
<?php |
|
0 | 329 |
if ( current_user_can( 'create_users' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
330 |
_e( 'Add New User' ); |
0 | 331 |
} elseif ( current_user_can( 'promote_users' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
332 |
_e( 'Add Existing User' ); |
9 | 333 |
} |
334 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
335 |
</h1> |
0 | 336 |
|
9 | 337 |
<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?> |
0 | 338 |
<div class="error"> |
339 |
<ul> |
|
340 |
<?php |
|
9 | 341 |
foreach ( $errors->get_error_messages() as $err ) { |
342 |
echo "<li>$err</li>\n"; |
|
343 |
} |
|
0 | 344 |
?> |
345 |
</ul> |
|
346 |
</div> |
|
9 | 347 |
<?php |
348 |
endif; |
|
0 | 349 |
|
350 |
if ( ! empty( $messages ) ) { |
|
9 | 351 |
foreach ( $messages as $msg ) { |
5 | 352 |
echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>'; |
9 | 353 |
} |
354 |
} |
|
355 |
?> |
|
0 | 356 |
|
9 | 357 |
<?php if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) : ?> |
0 | 358 |
<div class="error"> |
359 |
<?php |
|
9 | 360 |
foreach ( $add_user_errors->get_error_messages() as $message ) { |
361 |
echo "<p>$message</p>"; |
|
362 |
} |
|
0 | 363 |
?> |
364 |
</div> |
|
365 |
<?php endif; ?> |
|
366 |
<div id="ajax-response"></div> |
|
367 |
||
368 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
369 |
if ( is_multisite() && current_user_can( 'promote_users' ) ) { |
9 | 370 |
if ( $do_both ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
371 |
echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>'; |
9 | 372 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
373 |
if ( ! current_user_can( 'manage_network_users' ) ) { |
5 | 374 |
echo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>'; |
9 | 375 |
$label = __( 'Email' ); |
5 | 376 |
$type = 'email'; |
0 | 377 |
} else { |
5 | 378 |
echo '<p>' . __( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>'; |
9 | 379 |
$label = __( 'Email or Username' ); |
5 | 380 |
$type = 'text'; |
0 | 381 |
} |
9 | 382 |
?> |
383 |
<form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate" |
|
384 |
<?php |
|
5 | 385 |
/** |
386 |
* Fires inside the adduser form tag. |
|
387 |
* |
|
388 |
* @since 3.0.0 |
|
389 |
*/ |
|
390 |
do_action( 'user_new_form_tag' ); |
|
9 | 391 |
?> |
392 |
> |
|
0 | 393 |
<input name="action" type="hidden" value="adduser" /> |
9 | 394 |
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?> |
0 | 395 |
|
9 | 396 |
<table class="form-table" role="presentation"> |
0 | 397 |
<tr class="form-field form-required"> |
398 |
<th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th> |
|
5 | 399 |
<td><input name="email" type="<?php echo $type; ?>" id="adduser-email" class="wp-suggest-user" value="" /></td> |
0 | 400 |
</tr> |
401 |
<tr class="form-field"> |
|
9 | 402 |
<th scope="row"><label for="adduser-role"><?php _e( 'Role' ); ?></label></th> |
0 | 403 |
<td><select name="role" id="adduser-role"> |
9 | 404 |
<?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> |
0 | 405 |
</select> |
406 |
</td> |
|
407 |
</tr> |
|
9 | 408 |
<?php if ( current_user_can( 'manage_network_users' ) ) { ?> |
0 | 409 |
<tr> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
410 |
<th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
<td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
412 |
<input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
413 |
<label for="adduser-noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
414 |
</td> |
0 | 415 |
</tr> |
416 |
<?php } ?> |
|
417 |
</table> |
|
9 | 418 |
<?php |
419 |
/** |
|
420 |
* Fires at the end of the new user form. |
|
421 |
* |
|
422 |
* Passes a contextual string to make both types of new user forms |
|
423 |
* uniquely targetable. Contexts are 'add-existing-user' (Multisite), |
|
424 |
* and 'add-new-user' (single site and network admin). |
|
425 |
* |
|
426 |
* @since 3.7.0 |
|
427 |
* |
|
428 |
* @param string $type A contextual string specifying which type of new user form the hook follows. |
|
429 |
*/ |
|
430 |
do_action( 'user_new_form', 'add-existing-user' ); |
|
431 |
?> |
|
432 |
<?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?> |
|
0 | 433 |
</form> |
9 | 434 |
<?php |
0 | 435 |
} // is_multisite() |
436 |
||
9 | 437 |
if ( current_user_can( 'create_users' ) ) { |
438 |
if ( $do_both ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
439 |
echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>'; |
9 | 440 |
} |
441 |
?> |
|
442 |
<p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p> |
|
443 |
<form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate" |
|
444 |
<?php |
|
5 | 445 |
/** This action is documented in wp-admin/user-new.php */ |
446 |
do_action( 'user_new_form_tag' ); |
|
9 | 447 |
?> |
448 |
> |
|
0 | 449 |
<input name="action" type="hidden" value="createuser" /> |
9 | 450 |
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?> |
451 |
<?php |
|
452 |
// Load up the passed data, else set to a default. |
|
453 |
$creating = isset( $_POST['createuser'] ); |
|
5 | 454 |
|
9 | 455 |
$new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : ''; |
456 |
$new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : ''; |
|
457 |
$new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : ''; |
|
458 |
$new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; |
|
459 |
$new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : ''; |
|
460 |
$new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : ''; |
|
461 |
$new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true; |
|
462 |
$new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : ''; |
|
0 | 463 |
|
9 | 464 |
?> |
465 |
<table class="form-table" role="presentation"> |
|
0 | 466 |
<tr class="form-field form-required"> |
9 | 467 |
<th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
468 |
<td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" maxlength="60" /></td> |
0 | 469 |
</tr> |
470 |
<tr class="form-field form-required"> |
|
9 | 471 |
<th scope="row"><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> |
5 | 472 |
<td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td> |
0 | 473 |
</tr> |
9 | 474 |
<?php if ( ! is_multisite() ) { ?> |
0 | 475 |
<tr class="form-field"> |
9 | 476 |
<th scope="row"><label for="first_name"><?php _e( 'First Name' ); ?> </label></th> |
477 |
<td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr( $new_user_firstname ); ?>" /></td> |
|
0 | 478 |
</tr> |
479 |
<tr class="form-field"> |
|
9 | 480 |
<th scope="row"><label for="last_name"><?php _e( 'Last Name' ); ?> </label></th> |
481 |
<td><input name="last_name" type="text" id="last_name" value="<?php echo esc_attr( $new_user_lastname ); ?>" /></td> |
|
0 | 482 |
</tr> |
483 |
<tr class="form-field"> |
|
9 | 484 |
<th scope="row"><label for="url"><?php _e( 'Website' ); ?></label></th> |
5 | 485 |
<td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td> |
0 | 486 |
</tr> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
487 |
<tr class="form-field form-required user-pass1-wrap"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
488 |
<th scope="row"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
489 |
<label for="pass1"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
490 |
<?php _e( 'Password' ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
<span class="description hide-if-js"><?php _e( '(required)' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
492 |
</label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
493 |
</th> |
0 | 494 |
<td> |
495 |
<input class="hidden" value=" " /><!-- #24364 workaround --> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
496 |
<button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
497 |
<div class="wp-pwd hide-if-js"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
498 |
<?php $initial_password = wp_generate_password( 24 ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
499 |
<span class="password-input-wrapper"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
500 |
<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" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
501 |
</span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
502 |
<button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> |
9 | 503 |
<span class="dashicons dashicons-hidden" aria-hidden="true"></span> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
504 |
<span class="text"><?php _e( 'Hide' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
505 |
</button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
506 |
<button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>"> |
9 | 507 |
<span class="dashicons dashicons-no" aria-hidden="true"></span> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
508 |
<span class="text"><?php _e( 'Cancel' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
509 |
</button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
510 |
<div style="display:none" id="pass-strength-result" aria-live="polite"></div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
511 |
</div> |
0 | 512 |
</td> |
513 |
</tr> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
514 |
<tr class="form-field form-required user-pass2-wrap hide-if-js"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
515 |
<th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> |
0 | 516 |
<td> |
517 |
<input name="pass2" type="password" id="pass2" autocomplete="off" /> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
518 |
</td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
519 |
</tr> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
520 |
<tr class="pw-weak"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
521 |
<th><?php _e( 'Confirm Password' ); ?></th> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
522 |
<td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
523 |
<label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
524 |
<input type="checkbox" name="pw_weak" class="pw-checkbox" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
525 |
<?php _e( 'Confirm use of weak password' ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
526 |
</label> |
0 | 527 |
</td> |
528 |
</tr> |
|
529 |
<tr> |
|
9 | 530 |
<th scope="row"><?php _e( 'Send User Notification' ); ?></th> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
531 |
<td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
532 |
<input type="checkbox" name="send_user_notification" id="send_user_notification" value="1" <?php checked( $new_user_send_notification ); ?> /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
533 |
<label for="send_user_notification"><?php _e( 'Send the new user an email about their account.' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
534 |
</td> |
0 | 535 |
</tr> |
536 |
<?php } // !is_multisite ?> |
|
537 |
<tr class="form-field"> |
|
9 | 538 |
<th scope="row"><label for="role"><?php _e( 'Role' ); ?></label></th> |
0 | 539 |
<td><select name="role" id="role"> |
540 |
<?php |
|
9 | 541 |
if ( ! $new_user_role ) { |
542 |
$new_user_role = ! empty( $current_role ) ? $current_role : get_option( 'default_role' ); |
|
543 |
} |
|
544 |
wp_dropdown_roles( $new_user_role ); |
|
0 | 545 |
?> |
546 |
</select> |
|
547 |
</td> |
|
548 |
</tr> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
549 |
<?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?> |
0 | 550 |
<tr> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
551 |
<th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
552 |
<td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
553 |
<input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
554 |
<label for="noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation.' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
555 |
</td> |
0 | 556 |
</tr> |
557 |
<?php } ?> |
|
558 |
</table> |
|
559 |
||
9 | 560 |
<?php |
561 |
/** This action is documented in wp-admin/user-new.php */ |
|
562 |
do_action( 'user_new_form', 'add-new-user' ); |
|
563 |
?> |
|
0 | 564 |
|
9 | 565 |
<?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?> |
0 | 566 |
|
567 |
</form> |
|
568 |
<?php } // current_user_can('create_users') ?> |
|
569 |
</div> |
|
570 |
<?php |
|
571 |
include( ABSPATH . 'wp-admin/admin-footer.php' ); |