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