Ticket #5607: remove_admin_notices5.diff
File remove_admin_notices5.diff, 4.2 KB (added by , 17 years ago) |
---|
-
wp-admin/users.php
8 8 $title = __('Users'); 9 9 $parent_file = 'users.php'; 10 10 11 $action = $_REQUEST['action'];11 $action = ( isset($_REQUEST['action']) ) ? $_REQUEST['action'] : ''; 12 12 $update = ''; 13 13 14 14 if ( empty($_POST) ) { … … 61 61 $searches[] = $col . " LIKE '%$this->search_term%'"; 62 62 $search_sql .= implode(' OR ', $searches); 63 63 $search_sql .= ')'; 64 } else { 65 $search_sql = ''; 64 66 } 65 67 $this->query_from_where = "FROM $wpdb->users WHERE 1=1 $search_sql"; 66 68 … … 276 278 include('admin-header.php'); 277 279 278 280 // Query the users 279 $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage']);280 281 282 $usersearch = ( isset($_GET['usersearch']) ) ? $_GET['usersearch'] : null; 283 $userspage = ( isset($_GET['userspage']) ) ? $_GET['userspage'] : null; 284 $wp_user_search = new WP_User_Search($usersearch, $userspage); 285 281 286 // Make the user objects 282 287 foreach ( $wp_user_search->get_results() as $userid ) { 283 288 $tmp_user = new WP_User($userid); … … 320 325 } 321 326 endif; ?> 322 327 323 <?php if ( is_wp_error( $errors ) ) : ?>328 <?php if ( ! empty($errors) && is_wp_error( $errors ) ) : ?> 324 329 <div class="error"> 325 330 <ul> 326 331 <?php … … 429 434 </div> 430 435 431 436 <?php 432 if ( is_wp_error($add_user_errors) ) {437 if ( ! empty($add_user_errors) && is_wp_error($add_user_errors) ) { 433 438 foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { 434 439 $var = 'new_' . $var; 435 440 $$var = attribute_escape(stripslashes($_POST[$formpost])); … … 441 446 <div class="wrap"> 442 447 <h2 id="add-new-user"><?php _e('Add New User') ?></h2> 443 448 444 <?php if ( is_wp_error( $add_user_errors ) ) : ?>449 <?php if ( ! empty($add_user_errors) && is_wp_error( $add_user_errors ) ) : ?> 445 450 <div class="error"> 446 451 <?php 447 452 foreach ( $add_user_errors->get_error_messages() as $message ) … … 464 469 <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 465 470 <tr class="form-field form-required"> 466 471 <th scope="row" width="33%"><?php _e('Username (required)') ?><input name="action" type="hidden" id="action" value="adduser" /></th> 467 <td width="66%"><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" /></td>472 <td width="66%"><input name="user_login" type="text" id="user_login" value="<?php echo ( ! empty($new_user_login) ) ? $new_user_login : ''; ?>" /></td> 468 473 </tr> 469 474 <tr class="form-field"> 470 475 <th scope="row"><?php _e('First Name') ?> </th> 471 <td><input name="first_name" type="text" id="first_name" value="<?php echo $new_user_firstname; ?>" /></td>476 <td><input name="first_name" type="text" id="first_name" value="<?php echo ( ! empty($new_user_firstname) ) ? $new_user_firstname : ''; ?>" /></td> 472 477 </tr> 473 478 <tr class="form-field"> 474 479 <th scope="row"><?php _e('Last Name') ?> </th> 475 <td><input name="last_name" type="text" id="last_name" value="<?php echo $new_user_lastname; ?>" /></td>480 <td><input name="last_name" type="text" id="last_name" value="<?php echo ( ! empty($new_user_lastname) ) ? $new_user_lastname : ''; ?>" /></td> 476 481 </tr> 477 482 <tr class="form-field form-required"> 478 483 <th scope="row"><?php _e('E-mail (required)') ?></th> 479 <td><input name="email" type="text" id="email" value="<?php echo $new_user_email; ?>" /></td>484 <td><input name="email" type="text" id="email" value="<?php echo ( ! empty($new_user_email) ) ? $new_user_email : ''; ?>" /></td> 480 485 </tr> 481 486 <tr class="form-field"> 482 487 <th scope="row"><?php _e('Website') ?></th> 483 <td><input name="url" type="text" id="url" value="<?php echo $new_user_uri; ?>" /></td>488 <td><input name="url" type="text" id="url" value="<?php echo ( ! empty($new_user_uri) ) ? $new_user_uri : ''; ?>" /></td> 484 489 </tr> 485 490 486 491 <?php if ( apply_filters('show_password_fields', true) ) : ?> … … 496 501 <th scope="row"><?php _e('Role'); ?></th> 497 502 <td><select name="role" id="role"> 498 503 <?php 499 if ( !$new_user_role)504 if ( empty($new_user_role) ) 500 505 $new_user_role = get_option('default_role'); 501 506 wp_dropdown_roles($new_user_role); 502 507 ?>