What is the exact meta_key and meta_value for the field I created
using the function custom_user_profile_fields ?
created_by
and some user ID, for example:
$args = array(
'meta_key' => 'created_by',
'meta_value' => 123,
)
You could use a meta_query
for more complex searches.
$args = array(
'meta_query' => array(
array(
'key' => 'created_by',
'compare' => 'EXISTS',
),
)
);
var_dump(get_users($args));
Essentially, though, what you are doing is correct.
Related Posts:
- How do you add a custom option to user data?
- Show User Their Password
- How can I sort get_users() by any value (last_name, user defined fields and more)
- get_user_meta Short Profile Section
- WordPress User Profile Upload – If page is saved file reset
- WP_User_Query pulling ACF to loop
- Passing args to WP_User_Query am I using meta correctly?
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- check for duplicate user meta data before updating
- Custom Field Repeating When Using foreach
- Front-End User Profile
- Get emails from users by custom field SQL
- Save custom field types with this function…?
- Delete user meta but only if found in array
- Extend WP_User_Query or WP_User to return all custom fields?
- Echo text if field under user_meta is empty with get_users()
- Is it safe to store a user setting you don’t want the user to ever modify as a user option?
- Can I count the number of users matching a value in a multiple value key?
- Save custom user meta on registration
- Custom user avatar in the WordPress users listing
- User Profile / Add Custom Fields
- How to update serialized data in the user meta data
- Adding Properties to User Profile and Displaying in List
- Extra filed under “About the user” user profile
- Upload files programmatically to users
- Displaying additional User Contact Information
- 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?
- Redirect users based on custom field
- Custom User Profile Fields
- Add More Fields to Users Pages (Admin Panel)
- Register rest field for specific user
- 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
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- How to save multiple options from a dropdown in user profile
- How to show a gloabl message on a user profile page (in back end)?
- Users Select inside custom metabox
- Custom Fields – Taller editing area
- Front-end editing with custom fields?
- query usermeta from custom field
- custom avatar removal
- How to add upload video option in wordpress for user?
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Customizing user data
- Linking Custom Fields to Database Records
- How to save the date/time of last update of an extra user profile field?
- Show user info in a hovercard [closed]
- Customizing WP user profile with custom fields
- Iterate through users and display users meta info at front-page
- Show image if author meta (profile fields) exists outside loop
- How to add fields in custom registration form, validate it and aave to db? [closed]
- Increment user meta data by 1 each time a page is visited
- Front end register with custom fields
- award points to a user each time they update their cpt post
- How to update user profile custom fields
- How to parse a huge list of users using a CRON function?
- Display Additional Info
- Populate custom checkout fields with data from previous orders
- Auto populate a user custom field from another user custom field
- Add WordPress user custom meta to chartjs vertically stacked chart in Divi theme
- Adding data to User profile
- User query – getting values for custom meta keys/fields
- 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
- Get all user meta_keys and then group users by matching values
- How to save multiple custom user profile fields using repeater JQuery
- author.php not showing content if Author has no Posts
- Autofill advanced custom field with user data
- 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?
- Link fields in User Admin list
- Redirecting to an external URL
- update_user_meta(): invisible data storage
- 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
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- Semi-Private Comments + page comments -> is it possible?
- Custom registration form and custom field
- how to add radio field on user meta on function.php?
- file upload user profile
- Can’t sort custom column on user.php by number / meta_value_num?
- Create Unique and Customized User ID for Website Members in WordPress
- Add a Jquery Datepicker to custom field in post edit
- Custom fields PHP foreach loop
- Add custom option to Standard Page Attributes Meta Box
- how can i stop custom fields that have apostrophes from breaking my code
- create shortcode to list users with specific meta key value
- Want to make A CSS if meta key value is empty
- Problem with saving large amount of data in postmeta/usermeta
- Get user by meta key – WP multi site
- If metabox has content display content
- Listing the most popular 8 city (custom fields) as used in posts
- How to delete file uploaded by Plupload
- Is there a way to save different data when USER interacts with the same POST?
- Get all user with both meta_value