wp_get_current_user()
returns an object. update_user_meta( $user_id, $meta_key, $meta_value, $prev_value
) accepts user_id
as first parameter. Use the following code to get user ID from wp_get_current_user()
update_user_meta( $user->ID, 'custom_user_fields', $userData );
Related Posts:
- wp_update_user doesn’t update and update_user_meta does
- Get basic Image Uploader on User Profile Page
- Return all users with a specific meta key
- Capabilities Vs User Meta
- get_users is expecting unserialized meta_value
- remove user_meta data from database for all users
- How to get user metadata for social media url?
- Admin user edit – Grab newly submitted user meta immediately after update/submit
- Check if WP_User_Query ‘include’ is empty
- User meta to post
- Add profile field (usermeta) to Add New User
- How to Make admin Sidebar Menu always be Collapse by code
- Are the default entries for a user in wp_usermeta documented?
- How to query users by meta value, even when meta key doesn’t exist?
- Allow role to edit users at lower level with only specific metadata
- Hook or action to save profile fields at specific time
- Sanitize textarea instead of input
- Multiple User-Meta Values in One User-Meta Key
- Gravity Custom Merge Tags [closed]
- Possible bug: update_user_meta is updating two unique meta entries
- Update user meta through a front end form
- What is the difference between get_the_author_meta() and get_user_meta()?
- How to display current_user bio
- Is a user_meta research case-sensitive or not
- Can I prevent “wp_user_level” from getting added to wp_usermeta on registration?
- How to tell whether a user meta value has increased or decreased [closed]
- Adding current user’s ID to the end of PDF hyperlinks in post content
- Send mail to user only once when specific check box is selected and updated from profile meta updated by admin
- add custom field in user register form
- Is it possible to read a result if wp_update_user or update_user_meta fails?
- Why get_users() not working on the admin backend?
- Can I set user meta for theoretical user 0?
- Is there a way to append meta data without creating a race condition?
- strange issue with user_meta + json_encode/decode
- Inserting and finding multiple values in user-meta fields
- Update user meta on logout
- I want to update my user meta table
- Subscribers Group User meta delete
- Redirecting users based on custom user meta
- Multiple meta values for one meta key
- When is a user’s meta data table loaded?
- How do I add a dropdown list of numbers 1 – 1000 as an extra profile field?
- Get user meta for only the keys with a certain prefix
- Serializing User Role for update_user_meta
- Fetch user related data
- add_user_meta allows multiple clicks and inserts more than 1 value
- Add user meta fields on creating the user
- Order By Meta_key but convert custom date to Y-m-d first
- Using xprofile_insert_field
- editing usermeta when field is an array
- Combining wp_list_authors with get_user_meta
- Using WP for user management
- How to order users by a date in the meta_value array
- Show extra user profile meta for current user
- Pulling member name from WordPress URL
- Should I have a single cron job that loops the users, or one for each user?
- Save editor’s value in user meta and retrieve it
- 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
- E-mail Update – Validation
- Display Country Flag in Profile WordPress/Buddypress
- gform_after_submission not working as expected [closed]
- Remove user id’s stored in arrays that themselves are stored in user meta of another user
- Sort users by meta key value even if meta key not present for all users
- Fetch user’s using Last Name
- How to get metadata (in my case mail) of users who have a certain set of metadata?
- How can I search user meta by a partial key name?
- user metadata in json format, update the data partly only
- get_user_meta value is stored within strange characters
- check metadata in wordpress
- Why is my Custom User Meta deleted on Profile Update?
- wp_redirect not working after update_user_meta
- profile_update works on second update only
- How to remove the url format from the WEBSITE field in the user registry?
- users joined group count in buddypress
- Adding user metadata to all users
- Get user count based on multiple meta key values?
- Edit a user profile field on front end
- SQL – Shorter way to query user and usermeta data
- WP author meta disappeared
- How can I track who clicked what in my member area?
- Changing an array of IDs in the usermeta table to fit different format
- How to gets users EMAIL by their USERNAME
- Get user meta on registration hook
- Storing data to database and user registration
- add_user_meta() vs update_user_meta()
- How to get user meta value in wordpress
- How to display checkbox meta array values one by one?
- get user role value as a string from wp usermeta table into custom script
- Get currentuserinfo firstname and lastname
- How to toggle delete/update user meta values?
- Create a dropdown list displaying users meta data
- Multidimensional array problem with update_post_meta [duplicate]
- Using IDX feed to display agent’s and listings with agent’s info associated for Real Estate Website
- CRM and newsletter integration? [closed]
- Custom user meta data [closed]
- Custom user meta values in shortcode
- get user id from custom user meta key
- Can’t display user bio