[ Index ]

PHP Cross Reference of WordPress

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              $screen   = get_current_screen()->id;
 460              $sendback = wp_get_referer();
 461              $userids  = $_REQUEST['users'];
 462  
 463              /** This action is documented in wp-admin/edit.php */
 464              $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
 465  
 466              wp_safe_redirect( $sendback );
 467              exit;
 468          }
 469  
 470          $wp_list_table->prepare_items();
 471          $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
 472          if ( $pagenum > $total_pages && $total_pages > 0 ) {
 473              wp_redirect( add_query_arg( 'paged', $total_pages ) );
 474              exit;
 475          }
 476  
 477          include( ABSPATH . 'wp-admin/admin-header.php' );
 478  
 479          $messages = array();
 480          if ( isset( $_GET['update'] ) ) :
 481              switch ( $_GET['update'] ) {
 482                  case 'del':
 483                  case 'del_many':
 484                      $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
 485                      if ( 1 == $delete_count ) {
 486                          $message = __( 'User deleted.' );
 487                      } else {
 488                          /* translators: %s: Number of users. */
 489                          $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
 490                      }
 491                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
 492                      break;
 493                  case 'add':
 494                      $message = __( 'New user created.' );
 495  
 496                      $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
 497                      if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
 498                          $message .= sprintf(
 499                              ' <a href="%s">%s</a>',
 500                              esc_url(
 501                                  add_query_arg(
 502                                      'wp_http_referer',
 503                                      urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
 504                                      self_admin_url( 'user-edit.php?user_id=' . $user_id )
 505                                  )
 506                              ),
 507                              __( 'Edit user' )
 508                          );
 509                      }
 510  
 511                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>';
 512                      break;
 513                  case 'promote':
 514                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
 515                      break;
 516                  case 'err_admin_role':
 517                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user&#8217;s role must have user editing capabilities.' ) . '</p></div>';
 518                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';
 519                      break;
 520                  case 'err_admin_del':
 521                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You can&#8217;t delete the current user.' ) . '</p></div>';
 522                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';
 523                      break;
 524                  case 'remove':
 525                      $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>';
 526                      break;
 527                  case 'err_admin_remove':
 528                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( "You can't remove the current user." ) . '</p></div>';
 529                      $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>';
 530                      break;
 531              }
 532          endif;
 533          ?>
 534  
 535          <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
 536          <div class="error">
 537              <ul>
 538              <?php
 539              foreach ( $errors->get_error_messages() as $err ) {
 540                  echo "<li>$err</li>\n";
 541              }
 542              ?>
 543              </ul>
 544          </div>
 545              <?php
 546      endif;
 547  
 548          if ( ! empty( $messages ) ) {
 549              foreach ( $messages as $msg ) {
 550                  echo $msg;
 551              }
 552          }
 553          ?>
 554  
 555      <div class="wrap">
 556      <h1 class="wp-heading-inline">
 557          <?php
 558          echo esc_html( $title );
 559          ?>
 560  </h1>
 561  
 562          <?php
 563          if ( current_user_can( 'create_users' ) ) {
 564              ?>
 565      <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
 566  <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
 567      <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
 568              <?php
 569  }
 570  
 571  if ( strlen( $usersearch ) ) {
 572      /* translators: %s: Search query. */
 573      printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
 574  }
 575  ?>
 576  
 577  <hr class="wp-header-end">
 578  
 579          <?php $wp_list_table->views(); ?>
 580  
 581  <form method="get">
 582  
 583          <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
 584  
 585          <?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
 586  <input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
 587  <?php } ?>
 588  
 589          <?php $wp_list_table->display(); ?>
 590  </form>
 591  
 592  <br class="clear" />
 593  </div>
 594          <?php
 595          break;
 596  
 597  } // end of the $doaction switch
 598  
 599  include( ABSPATH . 'wp-admin/admin-footer.php' );


Generated: Wed Dec 11 01:00:03 2019 Cross-referenced by PHPXref 0.7.1