All of this can be done using WP_User_Query
:
$users = new WP_User_Query(array(
meta_query(
array( 'key' => 'login_status', 'value' => '0' ),
array( 'key' => 'active_code', 'value' => '3f7431e226893f16cbe44424850d00ad' )
)
));
This will return a list of users that meet your requirements. Then you can get the ids like so:
$user_ids = wp_list_pluck( $users->get_results(), 'ID' );
Related Posts:
- how to get list of all users and their metadata
- How to make a custom column on the Users admin screen sortable?
- Problem storing arrays with update_user_meta
- wp_get_current_user always returns 0
- How to get last login Access Date and time
- how to get specific fields from get_user_meta()
- Validating a new user registration field
- wp_get_current_user in custom file returns 0
- Is there a limit to the length/size of serialized data that can be stored as user meta?
- very last action before during user registration before he is redirected to homepage
- Customizing WP tables or adding new ones?
- get_users / WP_User_Query returns empty when logged out
- update_user_meta adding new rows in db for same key
- What is the meta-box-order_post_hash used for?
- Add a member number to new user
- User meta conventions / name registry, for social media links
- Get user’s ID on logout
- How to get the user description with get_users?
- get current user not working
- Getting $user_id for the_author_meta outside the loop in multisite
- Gravity Custom Merge Tags [closed]
- How to insert new element to existing array in usermeta?
- Store user’s registration date as meta
- Get the Google+ and Twitter links – WordPress SEO plugin
- Showing all users who match 2 meta fields with current user
- update_user_meta() not working
- How to display user’s avatar on their profile page?
- add custom field in user register form
- Is it possible to read a result if wp_update_user or update_user_meta fails?
- set a user-meta key as avatar
- Prevent update of custom user profile meta field on the front end after 1st entry
- User last login and user last visit problem
- Is there a way to append meta data without creating a race condition?
- update_user_meta after wordpress in action hooks
- trying to determine if meta value exists for user and if not auto submit gravity form to redirect
- get_user_meta returning old data
- Why does the usermeta table contain html entities?
- get_user_meta returning empty when it’s NOT empty
- How can I programmatically show a specific (template) page, like author.php?
- Multiple meta values for one meta key
- When is a user’s meta data table loaded?
- Display and Update User Custom Meta via user-edit.php
- Multiple Email Addresses, One User
- WordPress REST API and User meta data
- Serializing User Role for update_user_meta
- Get user_meta values for a user for an array of meta_keys?
- Displaying field value in new column in users view on wordpress
- add_user_meta allows multiple clicks and inserts more than 1 value
- Add user meta fields on creating the user
- How can I undo accidentally duplicated user metadata key values?
- How to add to a user_meta field (append)
- editing usermeta when field is an array
- How to order users by a date in the meta_value array
- How to order custom fields in the user profile (admin area)
- If logged in user views his profile page
- Add additional Fields for users and get value
- Getting a users username in get_user_meta
- Updating user meta on save post
- Save editor’s value in user meta and retrieve it
- How to get its meta_value of a specific meta_key within wp_usermeta
- How do i put in user id in a banner
- Exclude specific user_id from args in get_comments
- How do I sort a WP_USER_QUERY by multiple meta fields?
- WP_Editor not saving data in user_meta
- Update user meta array using foreach
- Can’t get the user_meta correctly
- get random users each time based on the meta key
- How $_GET[‘updated’] variable is passed when updating a user?
- How to display user_meta array as a table?
- user metadata in json format, update the data partly only
- check metadata in wordpress
- How can I return an error message when updating user meta?
- Adding user metadata to all users
- Get user count based on multiple meta key values?
- how to save multiple checkbox in usermeta and get it?
- Existing user_meta fields not updated
- get_the_author_meta i want to write in a loop
- How can I track who clicked what in my member area?
- Get user meta on registration hook
- update_user_meta inside a popup/modal
- add_user_meta() vs update_user_meta()
- Get all data form users and users metakey
- How to get user meta value in wordpress
- How to display checkbox meta array values one by one?
- User biographical information erased on login
- If logged in user meta is
- Store Foreach in user profile
- WP Cron: Save third party data as user meta
- Reordering fields in registration form via custom plugin
- use single form to enter multiple profiles
- Allow users to create and store data and retrieve it on login
- How to access User meta data within a plugin
- user profile replace first name last name with custom values
- Strip Twitter Username from Profile Field with URL and Save to New Profile Field
- Custom user meta values in shortcode
- Update another users meta
- WPML – how to translate user profile fields with icl_t()? [closed]
- Creating a Digital Download facility and track downloads [closed]
- Find matches of a variable in custom usermeta
- Can’t display user bio