[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/ -> users.php (source)

   1  <?php
   2  /**
   3   * User administration panel
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   * @since 1.0.0
   8   */
   9  
  10  /** WordPress Administration Bootstrap */
  11  require_once( dirname( __FILE__ ) . '/admin.php' );
  12  
  13  if ( ! current_user_can( 'list_users' ) ) {
  14      wp_die(
  15          '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
  16          '<p>' . __( 'Sorry, you are not allowed to list users.' ) . '</p>',
  17          403
  18      );
  19  }
  20  
  21  $wp_list_table = _get_list_table( 'WP_Users_List_Table' );
  22  $pagenum       = $wp_list_table->get_pagenum();
  23  $title         = __( 'Users' );
  24  $parent_file   = 'users.php';
  25  
  26  add_screen_option( 'per_page' );
  27  
  28  // contextual help - choose Help on the top right of admin panel to preview this.
  29  get_current_screen()->add_help_tab(
  30      array(
  31          'id'      => 'overview',
  32          'title'   => __( 'Overview' ),
  33          'content' => '<p>' . __( 'This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.' ) . '</p>' .
  34                          '<p>' . __( 'To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.' ) . '</p>',
  35      )
  36  );
  37  
  38  get_current_screen()->add_help_tab(
  39      array(
  40          'id'      => 'screen-content',
  41          'title'   => __( 'Screen Content' ),
  42          'content' => '<p>' . __( 'You can customize the display of this screen in a number of ways:' ) . '</p>' .
  43                          '<ul>' .
  44                          '<li>' . __( 'You can hide/display columns based on your needs and decide how many users to list per screen using the Screen Options tab.' ) . '</li>' .
  45                          '<li>' . __( 'You can filter the list of users by User Role using the text links above the users list to show All, Administrator, Editor, Author, Contributor, or Subscriber. The default view is to show all users. Unused User Roles are not listed.' ) . '</li>' .
  46                          '<li>' . __( 'You can view all posts made by a user by clicking on the number under the Posts column.' ) . '</li>' .
  47                          '</ul>',
  48      )
  49  );
  50  
  51  $help = '<p>' . __( 'Hovering over a row in the users list will display action links that allow you to manage users. You can perform the following actions:' ) . '</p>' .
  52      '<ul>' .
  53      '<li>' . __( '<strong>Edit</strong> takes you to the editable profile screen for that user. You can also reach that screen by clicking on the username.' ) . '</li>';
  54  
  55  if ( is_multisite() ) {
  56      $help .= '<li>' . __( '<strong>Remove</strong> allows you to remove a user from your site. It does not delete their content. You can also remove multiple users at once by using Bulk Actions.' ) . '</li>';
  57  } else {
  58      $help .= '<li>' . __( '<strong>Delete</strong> brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their content. You can also delete multiple users at once by using Bulk Actions.' ) . '</li>';
  59  }
  60  
  61  $help .= '</ul>';
  62  
  63  get_current_screen()->add_help_tab(
  64      array(
  65          'id'      => 'action-links',
  66          'title'   => __( 'Available Actions' ),
  67          'content' => $help,
  68      )
  69  );
  70  unset( $help );
  71  
  72  get_current_screen()->set_help_sidebar(
  73      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
  74      '<p>' . __( '<a href="https://wordpress.org/support/article/users-screen/">Documentation on Managing Users</a>' ) . '</p>' .
  75      '<p>' . __( '<a href="https://wordpress.org/support/article/roles-and-capabilities/">Descriptions of Roles and Capabilities</a>' ) . '</p>' .
  76      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
  77  );
  78  
  79  get_current_screen()->set_screen_reader_content(
  80      array(
  81          'heading_views'      => __( 'Filter users list' ),
  82          'heading_pagination' => __( 'Users list navigation' ),
  83          'heading_list'       => __( 'Users list' ),
  84      )
  85  );
  86  
  87  if ( empty( $_REQUEST ) ) {
  88      $referer = '<input type="hidden" name="wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
  89  } elseif ( isset( $_REQUEST['wp_http_referer'] ) ) {
  90      $redirect = remove_query_arg( array( 'wp_http_referer', 'updated', 'delete_count' ), wp_unslash( $_REQUEST['wp_http_referer'] ) );
  91      $referer  = '<input type="hidden" name="wp_http_referer" value="' . esc_attr( $redirect ) . '" />';
  92  } else {
  93      $redirect = 'users.php';
  94      $referer  = '';
  95  }
  96  
  97  $update = '';
  98  
  99  switch ( $wp_list_table->current_action() ) {
 100  
 101      /* Bulk Dropdown menu Role changes */
 102      case 'promote':
 103          check_admin_referer( 'bulk-users' );
 104  
 105          if ( ! current_user_can( 'promote_users' ) ) {
 106              wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );
 107          }
 108  
 109          if ( empty( $_REQUEST['users'] ) ) {
 110              wp_redirect( $redirect );
 111              exit();
 112          }
 113  
 114          $editable_roles = get_editable_roles();
 115          $role           = false;
 116          if ( ! empty( $_REQUEST['new_role2'] ) ) {
 117              $role = $_REQUEST['new_role2'];
 118          } elseif ( ! empty( $_REQUEST['new_role'] ) ) {
 119              $role = $_REQUEST['new_role'];
 120          }
 121  
 122          if ( ! $role || empty( $editable_roles[ $role ] ) ) {
 123              wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
 124          }
 125  
 126          $userids = $_REQUEST['users'];
 127          $update  = 'promote';
 128          foreach ( $userids as $id ) {
 129              $id = (int) $id;
 130  
 131              if ( ! current_user_can( 'promote_user', $id ) ) {
 132                  wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 );
 133              }
 134              // The new role of the current user must also have the promote_users cap or be a multisite super admin
 135              if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
 136              && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {
 137                      $update = 'err_admin_role';
 138                      continue;
 139              }
 140  
 141              // If the user doesn't already belong to the blog, bail.
 142              if ( is_multisite() && ! is_user_member_of_blog( $id ) ) {
 143                  wp_die(
 144                      '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
 145                      '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
 146                      403
 147                  );
 148              }
 149  
 150              $user = get_userdata( $id );
 151              $user->set_role( $role );
 152          }
 153  
 154          wp_redirect( add_query_arg( 'update', $update, $redirect ) );
 155          exit();
 156  
 157      case 'dodelete':
 158          if ( is_multisite() ) {
 159              wp_die( __( 'User deletion is not allowed from this screen.' ), 400 );
 160          }
 161  
 162          check_admin_referer( 'delete-users' );
 163  
 164          if ( empty( $_REQUEST['users'] ) ) {
 165              wp_redirect( $redirect );
 166              exit();
 167          }
 168  
 169          $userids = array_map( 'intval', (array) $_REQUEST['users'] );
 170  
 171          if ( empty( $_REQUEST['delete_option'] ) ) {
 172              $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $userids ) . '&error=true' );
 173              $url = str_replace( '&amp;', '&', wp_nonce_url( $url, 'bulk-users' ) );
 174              wp_redirect( $url );
 175              exit;
 176          }
 177  
 178          if ( ! current_user_can( 'delete_users' ) ) {
 179              wp_die( __( 'Sorry, you are not allowed to delete users.' ), 403 );
 180          }
 181  
 182          $update       = 'del';
 183          $delete_count = 0;
 184  
 185          foreach ( $userids as $id ) {
 186              if ( ! current_user_can( 'delete_user', $id ) ) {
 187                  wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 );
 188              }
 189  
 190              if ( $id == $current_user->ID ) {
 191                  $update = 'err_admin_del';
 192                  continue;
 193              }
 194              switch ( $_REQUEST['delete_option'] ) {
 195                  case 'delete':
 196                      wp_delete_user( $id );
 197                      break;
 198                  case 'reassign':
 199                      wp_delete_user( $id, $_REQUEST['reassign_user'] );
 200                      break;
 201              }
 202              ++$delete_count;
 203          }
 204  
 205          $redirect = add_query_arg(
 206              array(
 207                  'delete_count' => $delete_count,
 208                  'update'       => $update,
 209              ),
 210              $redirect
 211          );
 212          wp_redirect( $redirect );
 213          exit();
 214  
 215      case 'delete':
 216          if ( is_multisite() ) {
 217              wp_die( __( 'User deletion is not allowed from this screen.' ), 400 );
 218          }
 219  
 220          check_admin_referer( 'bulk-users' );
 221  
 222          if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
 223              wp_redirect( $redirect );
 224              exit();
 225          }
 226  
 227          if ( ! current_user_can( 'delete_users' ) ) {
 228              $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to delete users.' ) );
 229          }
 230  
 231          if ( empty( $_REQUEST['users'] ) ) {
 232              $userids = array( intval( $_REQUEST['user'] ) );
 233          } else {
 234              $userids = array_map( 'intval', (array) $_REQUEST['users'] );
 235          }
 236  
 237          $all_userids = $userids;
 238  
 239          if ( in_array( $current_user->ID, $userids ) ) {
 240              $userids = array_diff( $userids, array( $current_user->ID ) );
 241          }
 242  
 243          /**
 244           * Filters whether the users being deleted have additional content
 245           * associated with them outside of the `post_author` and `link_owner` relationships.
 246           *
 247           * @since 5.2.0
 248           *
 249           * @param boolean $users_have_additional_content Whether the users have additional content. Default false.
 250           * @param int[]   $userids                       Array of IDs for users being deleted.
 251           */
 252          $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids );
 253  
 254          if ( $userids && ! $users_have_content ) {
 255              if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
 256                  $users_have_content = true;
 257              } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
 258                  $users_have_content = true;
 259              }
 260          }
 261  
 262          if ( $users_have_content ) {
 263              add_action( 'admin_head', 'delete_users_add_js' );
 264          }
 265  
 266          include ( ABSPATH . 'wp-admin/admin-header.php' );
 267          ?>
 268      <form method="post" name="updateusers" id="updateusers">
 269          <?php wp_nonce_field( 'delete-users' ); ?>
 270          <?php echo $referer; ?>
 271  
 272  <div class="wrap">
 273  <h1><?php _e( 'Delete Users' ); ?></h1>
 274          <?php if ( isset( $_REQUEST['error'] ) ) : ?>
 275      <div class="error">
 276          <p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
 277      </div>
 278          <?php endif; ?>
 279  
 280          <?php if ( 1 == count( $all_userids ) ) : ?>
 281      <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
 282          <?php else : ?>
 283      <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
 284          <?php endif; ?>
 285  
 286  <ul>
 287          <?php
 288          $go_delete = 0;
 289          foreach ( $all_userids as $id ) {
 290              $user = get_userdata( $id );
 291              if ( $id == $current_user->ID ) {
 292                  /* translators: 1: User ID, 2: User login. */
 293                  echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n";
 294              } else {
 295                  /* translators: 1: User ID, 2: User login. */
 296                  echo '<li><input type="hidden" name="users[]" value="' . esc_attr( $id ) . '" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
 297                  $go_delete++;
 298              }
 299          }
 300          ?>
 301      </ul>
 302          <?php
 303          if ( $go_delete ) :
 304  
 305              if ( ! $users_have_content ) :
 306                  ?>
 307              <input type="hidden" name="delete_option" value="delete" />
 308              <?php else : ?>
 309                  <?php if ( 1 == $go_delete ) : ?>
 310              <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
 311          <?php else : ?>
 312              <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
 313          <?php endif; ?>
 314          <ul style="list-style:none;">
 315              <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
 316                  <?php _e( 'Delete all content.' ); ?></label></li>
 317              <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
 318                  <?php
 319                  echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> ';
 320                  wp_dropdown_users(
 321                      array(
 322                          'name'    => 'reassign_user',
 323                          'exclude' => $userids,
 324                          'show'    => 'display_name_with_login',
 325                      )
 326                  );
 327                  ?>
 328              </li>
 329          </ul></fieldset>
 330                  <?php
 331      endif;
 332              /**
 333               * Fires at the end of the delete users form prior to the confirm button.
 334               *
 335               * @since 4.0.0
 336               * @since 4.5.0 The `$userids` parameter was added.
 337               *
 338               * @param WP_User $current_user WP_User object for the current user.
 339               * @param int[]   $userids      Array of IDs for users being deleted.
 340               */
 341              do_action( 'delete_user_form', $current_user, $userids );
 342              ?>
 343      <input type="hidden" name="action" value="dodelete" />
 344              <?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
 345      <?php else : ?>
 346      <p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>
 347      <?php endif; ?>
 348      </div>
 349      </form>
 350          <?php
 351  
 352          break;
 353  
 354      case 'doremove':
 355          check_admin_referer( 'remove-users' );
 356  
 357          if ( ! is_multisite() ) {
 358              wp_die( __( 'You can&#8217;t remove users.' ), 400 );
 359          }
 360  
 361          if ( empty( $_REQUEST['users'] ) ) {
 362              wp_redirect( $redirect );
 363              exit;
 364          }
 365  
 366          if ( ! current_user_can( 'remove_users' ) ) {
 367              wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
 368          }
 369  
 370          $userids = $_REQUEST['users'];
 371  
 372          $update = 'remove';
 373          foreach ( $userids as $id ) {
 374              $id = (int) $id;
 375              if ( ! current_user_can( 'remove_user', $id ) ) {
 376                  $update = 'err_admin_remove';
 377                  continue;
 378              }
 379              remove_user_from_blog( $id, $blog_id );
 380          }
 381  
 382          $redirect = add_query_arg( array( 'update' => $update ), $redirect );
 383          wp_redirect( $redirect );
 384          exit;
 385  
 386      case 'remove':
 387          check_admin_referer( 'bulk-users' );
 388  
 389          if ( ! is_multisite() ) {
 390              wp_die( __( 'You can&#8217;t remove users.' ), 400 );
 391          }
 392  
 393          if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
 394              wp_redirect( $redirect );
 395              exit();
 396          }
 397  
 398          if ( ! current_user_can( 'remove_users' ) ) {
 399              $error = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to remove users.' ) );
 400          }
 401  
 402          if ( empty( $_REQUEST['users'] ) ) {
 403              $userids = array( intval( $_REQUEST['user'] ) );
 404          } else {
 405              $userids = $_REQUEST['users'];
 406          }
 407  
 408          include ( ABSPATH . 'wp-admin/admin-header.php' );
 409          ?>
 410      <form method="post" name="updateusers" id="updateusers">
 411          <?php wp_nonce_field( 'remove-users' ); ?>
 412          <?php echo $referer; ?>
 413  
 414  <div class="wrap">
 415  <h1><?php _e( 'Remove Users from Site' ); ?></h1>
 416  
 417          <?php if ( 1 == count( $userids ) ) : ?>
 418      <p><?php _e( 'You have specified this user for removal:' ); ?></p>
 419          <?php else : ?>
 420      <p><?php _e( 'You have specified these users for removal:' ); ?></p>
 421          <?php endif; ?>
 422  
 423  <ul>
 424          <?php
 425          $go_remove = false;
 426          foreach ( $userids as $id ) {
 427              $id   = (int) $id;
 428              $user = get_userdata( $id );
 429              if ( ! current_user_can( 'remove_user', $id ) ) {
 430                  /* translators: 1: User ID, 2: User login. */
 431                  echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>Sorry, you are not allowed to remove this user.</strong>' ), $id, $user->user_login ) . "</li>\n";
 432              } else {
 433                  /* translators: 1: User ID, 2: User login. */
 434                  echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
 435                  $go_remove = true;
 436              }
 437          }
 438          ?>
 439      </ul>
 440          <?php if ( $go_remove ) : ?>
 441          <input type="hidden" name="action" value="doremove" />
 442              <?php submit_button( __( 'Confirm Removal' ), 'primary' ); ?>
 443      <?php else : ?>
 444      <p><?php _e( 'There are no valid users selected for removal.' ); ?></p>
 445      <?php endif; ?>
 446      </div>
 447      </form>
 448          <?php
 449  
 450          break;
 451  
 452      default:
 453          if ( ! empty( $_GET['_wp_http_referer'] ) ) {
 454              wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
 455              exit;
 456          }
 457  
 458          if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {
 459              $userids  = $_REQUEST['users'];
 460              $sendback = wp_get_referer();
 461  
 462              /** This action is documented in wp-admin/edit-comments.php */
 463              $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
 464  
 465              wp_safe_redirect( $sendback );
 466              exit;
 467          }
 468  
 469          $wp_list_table->prepare_items();
 470          $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
 471          if ( $pagenum > $total_pages && $total_pages > 0 ) {
 472              wp_redirect( add_query_arg( 'paged', $total_pages ) );
 473              exit;
 474          }
 475  
 476          include ( ABSPATH . 'wp-admin/admin-header.php' );
 477  
 478          $messages = array();
 479          if ( isset( $_GET['update'] ) ) :
 480              switch ( $_GET['update'] ) {
 481                  case 'del':
 482                  case 'del_many':
 483                      $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
 484                      if ( 1 == $delete_count ) {
 485                          $message = __( 'User deleted.' );
 486                      } else {
 487                          /* translators: %s: Number of users. */
 488                          $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
 489                      }
 490                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
 491                      break;
 492                  case 'add':
 493                      $message = __( 'New user created.' );
 494  
 495                      $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
 496                      if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
 497                          $message .= sprintf(
 498                              ' <a href="%s">%s</a>',
 499                              esc_url(
 500                                  add_query_arg(
 501                                      'wp_http_referer',
 502                                      urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
 503                                      self_admin_url( 'user-edit.php?user_id=' . $user_id )
 504                                  )
 505                              ),
 506                              __( 'Edit user' )
 507                          );
 508                      }
 509  
 510                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>';
 511                      break;
 512                  case 'promote':
 513                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
 514                      break;
 515                  case 'err_admin_role':
 516                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user&#8217;s role must have user editing capabilities.' ) . '</p></div>';
 517                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';
 518                      break;
 519                  case 'err_admin_del':
 520                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You can&#8217;t delete the current user.' ) . '</p></div>';
 521                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';
 522                      break;
 523                  case 'remove':
 524                      $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>';
 525                      break;
 526                  case 'err_admin_remove':
 527                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( "You can't remove the current user." ) . '</p></div>';
 528                      $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>';
 529                      break;
 530              }
 531          endif;
 532          ?>
 533  
 534          <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
 535          <div class="error">
 536              <ul>
 537              <?php
 538              foreach ( $errors->get_error_messages() as $err ) {
 539                  echo "<li>$err</li>\n";
 540              }
 541              ?>
 542              </ul>
 543          </div>
 544              <?php
 545      endif;
 546  
 547          if ( ! empty( $messages ) ) {
 548              foreach ( $messages as $msg ) {
 549                  echo $msg;
 550              }
 551          }
 552          ?>
 553  
 554      <div class="wrap">
 555      <h1 class="wp-heading-inline">
 556          <?php
 557          echo esc_html( $title );
 558          ?>
 559  </h1>
 560  
 561          <?php
 562          if ( current_user_can( 'create_users' ) ) {
 563              ?>
 564      <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
 565  <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
 566      <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
 567              <?php
 568  }
 569  
 570  if ( strlen( $usersearch ) ) {
 571      /* translators: %s: Search query. */
 572      printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
 573  }
 574  ?>
 575  
 576  <hr class="wp-header-end">
 577  
 578          <?php $wp_list_table->views(); ?>
 579  
 580  <form method="get">
 581  
 582          <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
 583  
 584          <?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
 585  <input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
 586  <?php } ?>
 587  
 588          <?php $wp_list_table->display(); ?>
 589  </form>
 590  
 591  <br class="clear" />
 592  </div>
 593          <?php
 594          break;
 595  
 596  } // end of the $doaction switch
 597  
 598  include ( ABSPATH . 'wp-admin/admin-footer.php' );


Generated: Wed Oct 23 08:20:01 2019 Cross-referenced by PHPXref 0.7