Here’s what I use:
<?php global $current_user; wp_get_current_user(); ?>
<?php if ( is_user_logged_in() ) {
echo 'User ID: ' . $current_user->ID . "<br>";
?>
<a href="<?php echo $current_user->favorite_url;?>">View</a> <?php
}
else { wp_loginout(); } ?>
You can just use the ID you have and change $current_user->ID to $current_user->user-country
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 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
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- 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?
- Problem with serialized arrays in custom meta
- explode array within shortcode
- How to delete custom field “suggestions” from dropdown list
- How to get a meta value from all post
- Adding existing user custom field value to a woocommerce product [closed]
- How to save values of a custom input field on the Network > Site Info screen
- How to load php file for specific page in admin?
- ajax jquery update custom field meta value front end
- Add input field to ‘Pages > Edit Page’ through functions.php
- get_post_meta not working inside loop
- How do I exclude posts by custom field value?
- Auto populate a meta box field from another meta box field when publish or save
- Eliminating the appearance of a specific custom field in a post
- Conditional custom field query
- Display two custom values from a post
- Find page IDs with specific meta tag key value pairs
- Order query by meta_value with multiple custom fields
- Send email with custom fields after new draft is saved or new post published
- Get posts with same meta value as current post
- Add custom field to all posts in specific post_type
- query posts custom field calculation value
- Get Data From wp_sitemeta for Multisite network
- Syntax Issue: How Do I Call A Custom Field Inside a ForEach Statement? [closed]
- Singleton Custom Field (Meta Box)
- How to update a custom field in all posts with the value of another custom field in the same post?
- Get YouTube video id from url in a custom field
- How to insert multiple checkbox values into post as custom fields from frontend
- Trying to implement AJAX into my admin pages. Am I improperly enqueue and localizing my scripts?
- Fallback for empty custom fields
- Problem with writting correctly a query posts args in WordPress
- Add a field to just ONE page
- get_post_custom_values problem, please help
- How do I upload file through custom field, save it to database and get it
- How To Save Data From Remote APIs To ACF?
- Convert author metadata to a custom field
- Custom pages or Custom Posts
- get_avatar filter is not working as per requirement
- WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat
- searching by keywords in post’s metas or pagination links problem
- Permanently show Custom Fields in Editor
- Retrieve Google API JSON data and store as WordPress Custom Fields
- meta_query ‘compare’ => ‘!=’ not working
- Display Data From This Custom Media Upload Meta Box?
- Pagination not displaying correct number of pages