if ( ! current_user_can( 'manage_network_users' ) ) { wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); }
if ( isset( $_GET['action'] ) ) { /** This action is documented in wp-admin/network/edit.php */ do_action( 'wpmuadminedit' );
switch ( $_GET['action'] ) { case 'deleteuser': if ( ! current_user_can( 'manage_network_users' ) ) { wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); }
check_admin_referer( 'deleteuser' );
$id = (int) $_GET['id']; if ( $id > 1 ) { $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays.
// Used in the HTML title tag. $title = __( 'Users' ); $parent_file = 'users.php';
case 'spam': $user = get_userdata( $user_id ); if ( is_super_admin( $user->ID ) ) { wp_die( sprintf( /* translators: %s: User login. */ __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) ); }
foreach ( (array) $blogs as $details ) { if ( ! is_main_site( $details->userblog_id ) ) { // Main site is not a spam! update_blog_status( $details->userblog_id, 'spam', '1' ); } }
case 'dodelete': check_admin_referer( 'ms-users-delete' ); if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) ) { wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); }
// Used in the HTML title tag. $title = __( 'Users' ); $parent_file = 'users.php';
add_screen_option( 'per_page' );
get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This table shows all users across the network and the sites to which they are assigned.' ) . '</p>' . '<p>' . __( 'Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to their Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.' ) . '</p>' . '<p>' . __( 'You can also go to the user’s profile page by clicking on the individual username.' ) . '</p>' . '<p>' . __( 'You can sort the table by clicking on any of the table headings and switch between list and excerpt views by using the icons above the users list.' ) . '</p>' . '<p>' . __( 'The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.' ) . '</p>' . '<p>' . __( 'You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.' ) . '</p>', ) );