I use this function on functions.php in all my development websites
function imp($a){
echo '<pre>';
print_r($a);
echo '</pre>';
die();
}
now just use imp($user); where you are using get_user_meta ($user->ID).
you will have all the info about the $user, maybe this will tell you the answer you need…
You will find inside an object with ‘ID’, that’s why you can call $user->ID, if it were an array was possible to call $user[‘ID’].
normally with this function you can get all the info, sometimes are needed wordpress functions to get the info e.g. $user->get_ids(). but normally it is not needed.
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
- User meta conventions / name registry, for social media links
- Sanitize textarea instead of input
- Multiple User-Meta Values in One User-Meta Key
- 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
- WP_user_query throws a 404 error
- Incrementally add or substract from usermeta field
- Why get_users() not working on the admin backend?
- Can I set user meta for theoretical user 0?
- strange issue with user_meta + json_encode/decode
- Inserting and finding multiple values in user-meta fields
- Update user meta on logout
- Adding user data to an existing user_id
- I want to update my user meta table
- Subscribers Group User meta delete
- action user_new_form param is a string
- Redirecting users based on custom user meta
- Customize Avatar using user meta
- 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
- Randomize Users
- 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
- Order By Meta_key but convert custom date to Y-m-d first
- Using xprofile_insert_field
- 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?
- Updating user meta on save post
- 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
- 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
- get_the_author_meta i want to write in a loop
- 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]
- Strip Twitter Username from Profile Field with URL and Save to New Profile Field
- Custom user meta data [closed]
- Update another users meta
- Can’t display user bio