You are using pre_user_query according to WordPress documentation
Fires after the WP_User_Query has been parsed, and before the query is
executed
Then you should use pre_get_users just like pre_get_posts when your arguments have some meaning to WordPress.
pre_get_usersFires before the WP_User_Query has been parsed
Replace your hook with
add_action('pre_get_users', 'modify_user_list');
Related Posts:
- List users by last name in WP_User_Query
- Wp_User_Query not sorting by meta key
- WP_User_Query with combined meta query – not working?
- How to use search_columns in WP_User_Query?
- How to query users who have empty first_name?
- WordPress User getting added with id of 0
- WP User Query fails when searching meta queries and search columns
- Getting users by specific capability, not role
- how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard
- WP_User_Query – searching multiple fields
- Accessing current users data within a plugin
- How to activate the user search
- List Users alphabetically with heading
- is_user_logged_in() throwing undefined function error
- How to get the count
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- Display the line breaks in user bio without using html
- User with same Mail but a different additional info(like domain)
- SQL to set Display Name to First Name + Last Name
- Cannot update newly added User field using wp_update_user
- Getting user data via ajax
- Find count of WordPress users by role and search string for user name
- Sort users by custom user meta value
- Show only users with the same role in Dashboard user list
- Make WooCommerce pages accessible for logged in users only
- Ban a user and end their session
- How to limit users to one comment per post
- How to get the Gravityform entry ID from current user’s form submission? [closed]
- Post list based on the user that is logged in
- Extending WP_User class and using this sub-class during the whole lifecycle
- Why does is_user_logged_in() return false after redirect from another site?
- Set user after wp_create_user?
- Sort get_users by custom field
- Get user input from a form
- How to add new custom field in default add user form through plugin
- How to add wordpress username after url?
- User fields that can be edited by administrator?
- Admins can’t edit each other’s posts
- Update user_login to change username
- Can I bulk register contributors for a new blog
- show cimy user fields in users.php with manage_users_columns
- Why i getting blank user_activation_key in get_user_by( ‘login’, $login ) function?
- how do i get a greeting for logged in uses by the time of day
- Can’t add users in admin after copying database
- How can i create an array user meta?
- Exclude admin from user list
- When I try to login in wordpress it is showing “USER Doesn’t Exists”
- Displaying different in-page content to cliente/admin
- Can i add password field into my wp registration form?
- User capability for editing their own comments
- how to get WordPress admin user table columns name in my plugin
- Allow Contributors to Upload Files
- Create Next and Previous Link to User orderby Last Name
- Spam users registers even when registration is disabled
- Getting the age of a users account
- Prevent subscribers to changing certain profile fields
- New user form rejected because “passwords don’t match”—but there’s only one password field
- Unable to change email address of admin on localhost
- “the_author_meta(‘url’)” not working inside “href”
- REST API: wp_get_current_user not working on second call
- How do I filter users based on email address?
- What’s the correct way to add capabilites to user roles?
- Web app vs CMS backend
- User roles not displaying
- Allow admins to login as other users
- Should I setup frontend-only users as CPT or use a plug-in?
- How to expire user registration?
- Delete a user from frontend
- Echo a list of all subscriber’s user IDs
- wp_delete_user – huge overhead in Buddypress?
- Get current logged-in user from external site
- Delete all users with Editor role and their content mysql
- Send user auto generated password on different email
- How to hide “Change role to” dropdown on Users admin menu
- Get UserInfo from WordPress
- How can i display pagination in custom comment list?
- hide page menu from admin panel for specific users
- Single Sign On (SSO) between two WordPress websites
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- $user_login is not working if author has only 1 post
- REST_query_vars for users
- How to use a transient inside WP_User_Query
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Showing extra profile fields in admin – problem with underscore
- Add an ‘edit profile’ page with Genesis
- Exclude Current user email and send notification
- Extend WP_User_Query or WP_User to return all custom fields?
- User management missing after migration to new host
- Add new user and user bio at same time
- How to create a link to a user’s profile page
- Let admin users edit member profiles from front end
- Storing additional information about the user
- Current User Seeing Another Logged In User Info
- New User Registration email
- How can I list users by date in an array in meta_value?
- Email Subscribe for Downloads in WordPress
- Cant edit profile from frontend
- User Query Multiple Orderby Clause
- application password is missing