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_users
Fires 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
- Change the Author Slug from Username to Nickname
- How can 2 blogs share the same users
- Migrating WordPress users into Disqus
- How to display the status of users (online – offline) in archive.php
- Remove email verification when new user register
- How to change user`s avatar?
- How to display custom user meta from registration in backend?
- Grouping users under parent user
- How to update user role without logout
- How to create a public profile for authors/contributors/users?
- How to insert new values to WordPress user Firstname and Surname Fields via DB
- How we can get the user id by its display_name
- How to stop a user from updating the post date
- determining if the user is logged in
- Adding a photo to each WP user
- WordPress edit_user_profile_update update secondary role
- Check if user is online?
- How to check that if current user (ID) has posts or not
- How to get the Role Name of the current user? (WordPress)
- set_role has no effect
- Is it possible to duplicate users on a new WordPress install?
- Why don’t first_name and last_name appear when you print_r the WP_User object?
- WordPress to use Drupal users’ credentials
- How do I list in the backend all users that were assigned to a custom role?
- How to add local users to wordpress without email password?
- Call to undefined function wp_insert_user()
- Suddenly all emails in User have [email protected]
- Query users by capability – uninstall/deactivate callback
- Change the user_login at registration
- How to add a user profile page to frontend?
- Error: How to allow the “contributor” to upload media in wordpress
- get_user_meta an ID for multiple functions
- Custom default filtering in the user admin panel disables the other sortable columns
- Which function is called after update any field of user from any where of the site
- Register user when after filling contact form
- Is possible to allow user to login with different role?
- Creating user without username and password
- Is this code true or not
- Check for valid email after user inactivity?
- How do I let contributors edit their posts after being approved once?
- Export Users and their Advanced Custom Fields
- Hide hour from displaying when using user_registered
- Allow unfiltered HTML for not logged in users when saving a post
- Randomize Users
- How to copy user_nicename value into user_login
- How to check User Role and redirect to specific page according to Role when login in WordPress?
- Users – remove ‘send password’ checkbox
- Send email to all registered users [closed]
- Send clear password via mail
- How to get users by specific ID’s WordPress
- how to set default update_user_meta values wordpress
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- Didn’t get array of users like in delete action WPList table in users tab
- Cannot Update user meta in custom field
- How to programmatically read the plan text password when user register?
- Get user id after save post
- Redirect user to login if not logged in, on specific pages
- I want to change my user name
- Unique password to access a section site
- Followers for WordPress [duplicate]
- Cannot Modify Header Info Error on updating User Profile
- Is there a way to rate users instead of posts?
- Is it possible to build social networking website using WordPress?
- Easiest way to create an user across several websites
- Is there a way to call via javascript if a user is logged-in on a static html file?
- I need a link that directs the user that is logged to his profile
- Is this a hack? WordPress Usernames of every website we have changed into one single name automatically?
- The same session information for peer users on two different WordPress servers
- Custom User Page
- Browser extension to allow users to submit posts front end
- Changing the admin User Profile page
- user and usermeta table not found
- Users set passwords but cannot login
- Ordering list of users by last name and then by first name
- Separate Profiles for Users
- How to get current user ID in array meta_value?