If you have billing_phone
as user meta, which is the preferred way, that query would be incorrect. The advantage of utilizing custom user meta and adding a field for billing_phone
would allow you to use get_users()
.
$user = get_users('meta_key' => 'billing_phone', 'meta_value' => $phone_number, 'fields' => 'ID');
The above would give you an array of User IDs that have the matching billing_phone
meta value.
Related Posts:
- Can I count the number of users matching a value in a multiple value key?
- Save custom user meta on registration
- How to get users by a custom field / by user meta data?
- How do you add a custom option to user data?
- Show User Their Password
- How to update serialized data in the user meta data
- How can I sort get_users() by any value (last_name, user defined fields and more)
- Displaying additional User Contact Information
- get_user_meta Short Profile Section
- Separate table or usermeta
- meta_query for a string inside a meta field containing a comma-separated list
- How to update custom user meta field in wp?
- WordPress User Profile Upload – If page is saved file reset
- ACF: How to get the full field name (meta_key) by a field key?
- How do I create a column in Users list and display user data from custom registration field
- How to save multiple options from a dropdown in user profile
- WP_User_Query pulling ACF to loop
- Users Select inside custom metabox
- query usermeta from custom field
- custom avatar removal
- How to add upload video option in wordpress for user?
- Passing args to WP_User_Query am I using meta correctly?
- How to save the date/time of last update of an extra user profile field?
- Show image if author meta (profile fields) exists outside loop
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- How to add fields in custom registration form, validate it and aave to db? [closed]
- check for duplicate user meta data before updating
- Custom Field Repeating When Using foreach
- Increment user meta data by 1 each time a page is visited
- Front-End User Profile
- Get emails from users by custom field SQL
- award points to a user each time they update their cpt post
- How to update user profile custom fields
- Save custom field types with this function…?
- Display Additional Info
- Populate custom checkout fields with data from previous orders
- Add WordPress user custom meta to chartjs vertically stacked chart in Divi theme
- User query – getting values for custom meta keys/fields
- Delete user meta but only if found in array
- How to get data from user meta custom fields created with acf-pro plugin?
- How to save multiple values with same meta_key, each value linked to another tag id
- author.php not showing content if Author has no Posts
- Getting user’s data, by custom field lookup (meta)
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Redirecting to an external URL
- update_user_meta(): invisible data storage
- Extend WP_User_Query or WP_User to return all custom fields?
- Populate a select box with data stored in the database?
- Create custom fields/meta data gender+country – radiobuttons and dropdown on register screen for these fields
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- Is it possible in WordPress
- wordpress simple post multi rating with post_meta and user_meta
- Echo text if field under user_meta is empty with get_users()
- Custom registration form and custom field
- how to add radio field on user meta on function.php?
- Can’t sort custom column on user.php by number / meta_value_num?
- WP_Query – Order results by meta value
- Custom query with orderby meta_value of custom field
- How to enable revisions for post meta data?
- Any way to add custom options to Gallery Settings?
- Including custom fields in search?
- How to position a custom field before the editor
- passing argument to get_template_part() or a better way to code
- Bulk move (or copy) from a custom field to the post content?
- Getting Custom Field data from a page hierarchy
- limit amount of photos uploaded per cpt post
- Problem with adding exta field in metabox in custom post type
- Move value of one custom field to another
- little help with a mySQL query to wp database
- Calling custom profile fields?
- Performance of storing multiple meta fields vs one JSON encoded field [duplicate]
- how to put a custom field value in variable
- Custom Metabox Not Saving
- Manipulate javascript code from custom made admin page menu
- Add additional ‘description’ field for defined roles / role metadata?
- Change the main loop WordPress impact on the server?
- How to get categories with posts by custom field value?
- Meta Query returns wrong number of posts
- Walker class for sub-menu with ACF fields
- Add custom fields to existing posts (admin pages)
- Multiple instances of TinyMCE are removing tag
- How do i get the attached images with custom value checked?
- How to disable Edit Post and Allow only Custom Field?
- Convert attachment ID into url?
- How to query an out put value?
- do_shortcode close
- wordpress get_post_meta / the_meta to output custom field value
- Custom field metabox not showing in back-end
- Load one page with parent and child pages
- Why can’t I get the correct post permalink
- Use a different catalog image than the featured image
- Login Api with Meta_key and Meta_value
- How to diplay a div only if at least one author custom profile field is filled?
- Set custom field value when reaching expiration date
- Confusion on how to display custom field data
- How to allow user to add to, but not edit, a post?
- How to query posts that have certain post meta keys, and sort by meta key and/or value
- Add image custom attribute [closed]
- Foreach giving one too many list items, how can I remove the last empty line?
- I used a custom field for header image and can’t get it to show up on posts