Changeset 43571 for trunk/src/wp-admin/user-new.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/user-new.php
r42761 r43571 80 80 'update' => 'addnoconfirmation', 81 81 'user_id' => $user_id, 82 ), 'user-new.php' 82 ), 83 'user-new.php' 83 84 ); 84 85 } else { … … 88 89 $newuser_key = wp_generate_password( 20, false ); 89 90 add_option( 90 'new_user_' . $newuser_key, array( 91 'new_user_' . $newuser_key, 92 array( 91 93 'user_id' => $user_id, 92 94 'email' => $user_details->user_email, … … 177 179 } 178 180 wpmu_signup_user( 179 $new_user_login, $new_user_email, array( 181 $new_user_login, 182 $new_user_email, 183 array( 180 184 'add_to_blog' => get_current_blog_id(), 181 185 'new_role' => $_REQUEST['role'], … … 194 198 'update' => 'addnoconfirmation', 195 199 'user_id' => $new_user['user_id'], 196 ), 'user-new.php' 200 ), 201 'user-new.php' 197 202 ); 198 203 } … … 344 349 </ul> 345 350 </div> 346 <?php351 <?php 347 352 endif; 348 353 … … 379 384 $type = 'text'; 380 385 } 381 ?>386 ?> 382 387 <form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate" 383 <?php388 <?php 384 389 /** 385 390 * Fires inside the adduser form tag. … … 388 393 */ 389 394 do_action( 'user_new_form_tag' ); 390 ?>395 ?> 391 396 > 392 397 <input name="action" type="hidden" value="adduser" /> 393 <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>398 <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?> 394 399 395 400 <table class="form-table"> … … 405 410 </td> 406 411 </tr> 407 <?php if ( current_user_can( 'manage_network_users' ) ) { ?>412 <?php if ( current_user_can( 'manage_network_users' ) ) { ?> 408 413 <tr> 409 414 <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> … … 415 420 <?php } ?> 416 421 </table> 417 <?php418 /**419 * Fires at the end of the new user form.420 *421 * Passes a contextual string to make both types of new user forms422 * uniquely targetable. Contexts are 'add-existing-user' (Multisite),423 * and 'add-new-user' (single site and network admin).424 *425 * @since 3.7.0426 *427 * @param string $type A contextual string specifying which type of new user form the hook follows.428 */429 do_action( 'user_new_form', 'add-existing-user' );430 ?>431 <?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>422 <?php 423 /** 424 * Fires at the end of the new user form. 425 * 426 * Passes a contextual string to make both types of new user forms 427 * uniquely targetable. Contexts are 'add-existing-user' (Multisite), 428 * and 'add-new-user' (single site and network admin). 429 * 430 * @since 3.7.0 431 * 432 * @param string $type A contextual string specifying which type of new user form the hook follows. 433 */ 434 do_action( 'user_new_form', 'add-existing-user' ); 435 ?> 436 <?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?> 432 437 </form> 433 <?php438 <?php 434 439 } // is_multisite() 435 440 … … 438 443 echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>'; 439 444 } 440 ?>445 ?> 441 446 <p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p> 442 447 <form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate" 443 <?php448 <?php 444 449 /** This action is documented in wp-admin/user-new.php */ 445 450 do_action( 'user_new_form_tag' ); 446 ?>451 ?> 447 452 > 448 453 <input name="action" type="hidden" value="createuser" /> 449 <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>450 <?php451 // Load up the passed data, else set to a default.452 $creating = isset( $_POST['createuser'] );453 454 $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';455 $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';456 $new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : '';457 $new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : '';458 $new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : '';459 $new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : '';460 $new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true;461 $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : '';462 463 ?>454 <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?> 455 <?php 456 // Load up the passed data, else set to a default. 457 $creating = isset( $_POST['createuser'] ); 458 459 $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : ''; 460 $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : ''; 461 $new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : ''; 462 $new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; 463 $new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : ''; 464 $new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : ''; 465 $new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true; 466 $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : ''; 467 468 ?> 464 469 <table class="form-table"> 465 470 <tr class="form-field form-required"> … … 471 476 <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td> 472 477 </tr> 473 <?php if ( ! is_multisite() ) { ?>478 <?php if ( ! is_multisite() ) { ?> 474 479 <tr class="form-field"> 475 480 <th scope="row"><label for="first_name"><?php _e( 'First Name' ); ?> </label></th> … … 556 561 </table> 557 562 558 <?php559 /** This action is documented in wp-admin/user-new.php */560 do_action( 'user_new_form', 'add-new-user' );561 ?>562 563 <?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>563 <?php 564 /** This action is documented in wp-admin/user-new.php */ 565 do_action( 'user_new_form', 'add-new-user' ); 566 ?> 567 568 <?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?> 564 569 565 570 </form>
Note: See TracChangeset
for help on using the changeset viewer.