[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

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  __DIR__ . '/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  
 135              // The new role of the current user must also have the promote_users cap or be a multisite super admin.
 136              if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' )
 137              && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {
 138                      $update = 'err_admin_role';
 139                      continue;
 140              }
 141  
 142              // If the user doesn't already belong to the blog, bail.
 143              if ( is_multisite() && ! is_user_member_of_blog( $id ) ) {
 144                  wp_die(
 145                      '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
 146                      '<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
 147                      403
 148                  );
 149              }
 150  
 151              $user = get_userdata( $id );
 152              $user->set_role( $role );
 153          }
 154  
 155          wp_redirect( add_query_arg( 'update', $update, $redirect ) );
 156          exit;
 157  
 158      case 'dodelete':
 159          if ( is_multisite() ) {
 160              wp_die( __( 'User deletion is not allowed from this screen.' ), 400 );
 161          }
 162  
 163          check_admin_referer( 'delete-users' );
 164  
 165          if ( empty( $_REQUEST['users'] ) ) {
 166              wp_redirect( $redirect );
 167              exit;
 168          }
 169  
 170          $userids = array_map( 'intval', (array) $_REQUEST['users'] );
 171  
 172          if ( empty( $_REQUEST['delete_option'] ) ) {
 173              $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $userids ) . '&error=true' );
 174              $url = str_replace( '&amp;', '&', wp_nonce_url( $url, 'bulk-users' ) );
 175              wp_redirect( $url );
 176              exit;
 177          }
 178  
 179          if ( ! current_user_can( 'delete_users' ) ) {
 180              wp_die( __( 'Sorry, you are not allowed to delete users.' ), 403 );
 181          }
 182  
 183          $update       = 'del';
 184          $delete_count = 0;
 185  
 186          foreach ( $userids as $id ) {
 187              if ( ! current_user_can( 'delete_user', $id ) ) {
 188                  wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 );
 189              }
 190  
 191              if ( $id == $current_user->ID ) {
 192                  $update = 'err_admin_del';
 193                  continue;
 194              }
 195              switch ( $_REQUEST['delete_option'] ) {
 196                  case 'delete':
 197                      wp_delete_user( $id );
 198                      break;
 199                  case 'reassign':
 200                      wp_delete_user( $id, $_REQUEST['reassign_user'] );
 201                      break;
 202              }
 203              ++$delete_count;
 204          }
 205  
 206          $redirect = add_query_arg(
 207              array(
 208                  'delete_count' => $delete_count,
 209                  'update'       => $update,
 210              ),
 211              $redirect
 212          );
 213          wp_redirect( $redirect );
 214          exit;
 215  
 216      case 'delete':
 217          if ( is_multisite() ) {
 218              wp_die( __( 'User deletion is not allowed from this screen.' ), 400 );
 219          }
 220  
 221          check_admin_referer( 'bulk-users' );
 222  
 223          if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
 224              wp_redirect( $redirect );
 225              exit;
 226          }
 227  
 228          if ( ! current_user_can( 'delete_users' ) ) {
 229              $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to delete users.' ) );
 230          }
 231  
 232          if ( empty( $_REQUEST['users'] ) ) {
 233              $userids = array( intval( $_REQUEST['user'] ) );
 234          } else {
 235              $userids = array_map( 'intval', (array) $_REQUEST['users'] );
 236          }
 237  
 238          $all_userids = $userids;
 239  
 240          if ( in_array( $current_user->ID, $userids, true ) ) {
 241              $userids = array_diff( $userids, array( $current_user->ID ) );
 242          }
 243  
 244          /**
 245           * Filters whether the users being deleted have additional content
 246           * associated with them outside of the `post_author` and `link_owner` relationships.
 247           *
 248           * @since 5.2.0
 249           *
 250           * @param boolean $users_have_additional_content Whether the users have additional content. Default false.
 251           * @param int[]   $userids                       Array of IDs for users being deleted.
 252           */
 253          $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids );
 254  
 255          if ( $userids && ! $users_have_content ) {
 256              if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
 257                  $users_have_content = true;
 258              } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) {
 259                  $users_have_content = true;
 260              }
 261          }
 262  
 263          if ( $users_have_content ) {
 264              add_action( 'admin_head', 'delete_users_add_js' );
 265          }
 266  
 267          require_once  ABSPATH . 'wp-admin/admin-header.php';
 268          ?>
 269      <form method="post" name="updateusers" id="updateusers">
 270          <?php wp_nonce_field( 'delete-users' ); ?>
 271          <?php echo $referer; ?>
 272  
 273  <div class="wrap">
 274  <h1><?php _e( 'Delete Users' ); ?></h1>
 275          <?php if ( isset( $_REQUEST['error'] ) ) : ?>
 276      <div class="error">
 277          <p><strong><?php _e( 'Error:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
 278      </div>
 279          <?php endif; ?>
 280  
 281          <?php if ( 1 === count( $all_userids ) ) : ?>
 282      <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
 283          <?php else : ?>
 284      <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
 285          <?php endif; ?>
 286  
 287  <ul>
 288          <?php
 289          $go_delete = 0;
 290          foreach ( $all_userids as $id ) {
 291              $user = get_userdata( $id );
 292              if ( $id == $current_user->ID ) {
 293                  /* translators: 1: User ID, 2: User login. */
 294                  echo '<li>' . sprintf( __( 'ID #%1$s: %2$s <strong>The current user will not be deleted.</strong>' ), $id, $user->user_login ) . "</li>\n";
 295              } else {
 296                  /* translators: 1: User ID, 2: User login. */
 297                  echo '<li><input type="hidden" name="users[]" value="' . esc_attr( $id ) . '" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
 298                  $go_delete++;
 299              }
 300          }
 301          ?>
 302      </ul>
 303          <?php
 304          if ( $go_delete ) :
 305  
 306              if ( ! $users_have_content ) :
 307                  ?>
 308              <input type="hidden" name="delete_option" value="delete" />
 309              <?php else : ?>
 310                  <?php if ( 1 == $go_delete ) : ?>
 311              <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
 312          <?php else : ?>
 313              <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
 314          <?php endif; ?>
 315          <ul style="list-style:none;">
 316              <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
 317                  <?php _e( 'Delete all content.' ); ?></label></li>
 318              <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
 319                  <?php
 320                  echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> ';
 321                  wp_dropdown_users(
 322                      array(
 323                          'name'    => 'reassign_user',
 324                          'exclude' => $userids,
 325                          'show'    => 'display_name_with_login',
 326                      )
 327                  );
 328                  ?>
 329              </li>
 330          </ul></fieldset>
 331                  <?php
 332      endif;
 333              /**
 334               * Fires at the end of the delete users form prior to the confirm button.
 335               *
 336               * @since 4.0.0
 337               * @since 4.5.0 The `$userids` parameter was added.
 338               *
 339               * @param WP_User $current_user WP_User object for the current user.
 340               * @param int[]   $userids      Array of IDs for users being deleted.
 341               */
 342              do_action( 'delete_user_form', $current_user, $userids );
 343              ?>
 344      <input type="hidden" name="action" value="dodelete" />
 345              <?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
 346      <?php else : ?>
 347      <p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>
 348      <?php endif; ?>
 349      </div>
 350      </form>
 351          <?php
 352  
 353          break;
 354  
 355      case 'doremove':
 356          check_admin_referer( 'remove-users' );
 357  
 358          if ( ! is_multisite() ) {
 359              wp_die( __( 'You can&#8217;t remove users.' ), 400 );
 360          }
 361  
 362          if ( empty( $_REQUEST['users'] ) ) {
 363              wp_redirect( $redirect );
 364              exit;
 365          }
 366  
 367          if ( ! current_user_can( 'remove_users' ) ) {
 368              wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
 369          }
 370  
 371          $userids = $_REQUEST['users'];
 372  
 373          $update = 'remove';
 374          foreach ( $userids as $id ) {
 375              $id = (int) $id;
 376              if ( ! current_user_can( 'remove_user', $id ) ) {
 377                  $update = 'err_admin_remove';
 378                  continue;
 379              }
 380              remove_user_from_blog( $id, $blog_id );
 381          }
 382  
 383          $redirect = add_query_arg( array( 'update' => $update ), $redirect );
 384          wp_redirect( $redirect );
 385          exit;
 386  
 387      case 'remove':
 388          check_admin_referer( 'bulk-users' );
 389  
 390          if ( ! is_multisite() ) {
 391              wp_die( __( 'You can&#8217;t remove users.' ), 400 );
 392          }
 393  
 394          if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) {
 395              wp_redirect( $redirect );
 396              exit;
 397          }
 398  
 399          if ( ! current_user_can( 'remove_users' ) ) {
 400              $error = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to remove users.' ) );
 401          }
 402  
 403          if ( empty( $_REQUEST['users'] ) ) {
 404              $userids = array( intval( $_REQUEST['user'] ) );
 405          } else {
 406              $userids = $_REQUEST['users'];
 407          }
 408  
 409          require_once  ABSPATH . 'wp-admin/admin-header.php';
 410          ?>
 411      <form method="post" name="updateusers" id="updateusers">
 412          <?php wp_nonce_field( 'remove-users' ); ?>
 413          <?php echo $referer; ?>
 414  
 415  <div class="wrap">
 416  <h1><?php _e( 'Remove Users from Site' ); ?></h1>
 417  
 418          <?php if ( 1 === count( $userids ) ) : ?>
 419      <p><?php _e( 'You have specified this user for removal:' ); ?></p>
 420          <?php else : ?>
 421      <p><?php _e( 'You have specified these users for removal:' ); ?></p>
 422          <?php endif; ?>
 423  
 424  <ul>
 425          <?php
 426          $go_remove = false;
 427          foreach ( $userids as $id ) {
 428              $id   = (int) $id;
 429              $user = get_userdata( $id );
 430              if ( ! current_user_can( 'remove_user', $id ) ) {
 431                  /* translators: 1: User ID, 2: User login. */
 432                  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";
 433              } else {
 434                  /* translators: 1: User ID, 2: User login. */
 435                  echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
 436                  $go_remove = true;
 437              }
 438          }
 439          ?>
 440      </ul>
 441          <?php if ( $go_remove ) : ?>
 442          <input type="hidden" name="action" value="doremove" />
 443              <?php submit_button( __( 'Confirm Removal' ), 'primary' ); ?>
 444      <?php else : ?>
 445      <p><?php _e( 'There are no valid users selected for removal.' ); ?></p>
 446      <?php endif; ?>
 447      </div>
 448      </form>
 449          <?php
 450  
 451          break;
 452  
 453      default:
 454          if ( ! empty( $_GET['_wp_http_referer'] ) ) {
 455              wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
 456              exit;
 457          }
 458  
 459          if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {
 460              $screen   = get_current_screen()->id;
 461              $sendback = wp_get_referer();
 462              $userids  = $_REQUEST['users'];
 463  
 464              /** This action is documented in wp-admin/edit.php */
 465              $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
 466  
 467              wp_safe_redirect( $sendback );
 468              exit;
 469          }
 470  
 471          $wp_list_table->prepare_items();
 472          $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
 473          if ( $pagenum > $total_pages && $total_pages > 0 ) {
 474              wp_redirect( add_query_arg( 'paged', $total_pages ) );
 475              exit;
 476          }
 477  
 478          require_once  ABSPATH . 'wp-admin/admin-header.php';
 479  
 480          $messages = array();
 481          if ( isset( $_GET['update'] ) ) :
 482              switch ( $_GET['update'] ) {
 483                  case 'del':
 484                  case 'del_many':
 485                      $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
 486                      if ( 1 == $delete_count ) {
 487                          $message = __( 'User deleted.' );
 488                      } else {
 489                          /* translators: %s: Number of users. */
 490                          $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
 491                      }
 492                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
 493                      break;
 494                  case 'add':
 495                      $message = __( 'New user created.' );
 496  
 497                      $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
 498                      if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
 499                          $message .= sprintf(
 500                              ' <a href="%s">%s</a>',
 501                              esc_url(
 502                                  add_query_arg(
 503                                      'wp_http_referer',
 504                                      urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
 505                                      self_admin_url( 'user-edit.php?user_id=' . $user_id )
 506                                  )
 507                              ),
 508                              __( 'Edit user' )
 509                          );
 510                      }
 511  
 512                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>';
 513                      break;
 514                  case 'promote':
 515                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
 516                      break;
 517                  case 'err_admin_role':
 518                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user&#8217;s role must have user editing capabilities.' ) . '</p></div>';
 519                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';
 520                      break;
 521                  case 'err_admin_del':
 522                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You can&#8217;t delete the current user.' ) . '</p></div>';
 523                      $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';
 524                      break;
 525                  case 'remove':
 526                      $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>';
 527                      break;
 528                  case 'err_admin_remove':
 529                      $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( "You can't remove the current user." ) . '</p></div>';
 530                      $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>';
 531                      break;
 532              }
 533          endif;
 534          ?>
 535  
 536          <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
 537          <div class="error">
 538              <ul>
 539              <?php
 540              foreach ( $errors->get_error_messages() as $err ) {
 541                  echo "<li>$err</li>\n";
 542              }
 543              ?>
 544              </ul>
 545          </div>
 546              <?php
 547      endif;
 548  
 549          if ( ! empty( $messages ) ) {
 550              foreach ( $messages as $msg ) {
 551                  echo $msg;
 552              }
 553          }
 554          ?>
 555  
 556      <div class="wrap">
 557      <h1 class="wp-heading-inline">
 558          <?php
 559          echo esc_html( $title );
 560          ?>
 561  </h1>
 562  
 563          <?php
 564          if ( current_user_can( 'create_users' ) ) {
 565              ?>
 566      <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
 567  <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
 568      <a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
 569              <?php
 570  }
 571  
 572  if ( strlen( $usersearch ) ) {
 573      /* translators: %s: Search query. */
 574      printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
 575  }
 576  ?>
 577  
 578  <hr class="wp-header-end">
 579  
 580          <?php $wp_list_table->views(); ?>
 581  
 582  <form method="get">
 583  
 584          <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
 585  
 586          <?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
 587  <input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
 588  <?php } ?>
 589  
 590          <?php $wp_list_table->display(); ?>
 591  </form>
 592  
 593  <br class="clear" />
 594  </div>
 595          <?php
 596          break;
 597  
 598  } // End of the $doaction switch.
 599  
 600  require_once  ABSPATH . 'wp-admin/admin-footer.php';


Generated : Sun Jun 7 08:20:01 2020 Cross-referenced by PHPXref