You are trying to access the meta data of the user with ID stored in $user->ID but the object $user is not defined in your code. You are also using an undefined variable $user_ID.
The quickest fix in your code would be to change this:
get_the_author_meta( 'province', $user->ID ) )
With:
get_the_author_meta( 'province', $userdata->ID ) )
Tip: turn WP_DEBUG on to get notice about those kind of errrors.
Related Posts:
- Add Link to Users List (Backend) to open each users front-end profile
- Get a list of all available fields in the User Profile
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- How to add custom fields to my custom registration form
- Adding fields to the “Add New User” screen in the dashboard
- How to check if a user exists by a given id
- Use author author display name in permalink structure for pages and posts
- Logout redirect to current page – function
- How to paginate the get_users function?
- How to add first name & last name to default registration form?
- How to display random users with avatars
- How to manually activate user in dashboard only by admin
- Add new user : make the fields First Name and Last name required
- wp_delete_user with username
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- Order get_users() by last login date. Is it possible?
- How can I tell when a user is logged in?
- how to get and display logged in user’s recently read posts
- Displaying a random user with a shortcode
- How to update BuddyPress xprofile fields programmatically? [closed]
- How to detect first visit of a user?
- Can I pass two roles to the function get_users?
- How can I default to all WordPress roles when parameter is not included in shortcode?
- Create dropdown of users in admin dashboard
- Custom user profile URLs
- password protected post policy
- Remove the deleted users avatar from list
- Get Current User info using wp_localize_script, in functions.php
- create shortcode to list users with specific meta key value
- How to hide unused profile fields?
- Don’t delete a page if it holds users
- How to add a user profile page to frontend?
- How to make custom column Admin>Users sortable?
- Execute a ultimate member action when user role is updated
- How to force field validation first, then its values saved durning edit profile?
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Change label for registration Fields
- How to create a front end user profile with a friendly permalink and a 404 trigger
- Create post using Ajax
- How would I add “edit profile” and “blog post” functions to front-end?
- Condition OR for current user ID
- How to Use Global Variables Inside Header and Footer
- Secondary Menu and Logged In Users
- Why get_user_by() doesn’t work in my code?
- Filter to wp_list_authors
- Hide tab Buddypress profile for visitors, not logged in users
- How to add array [closed]
- Suggest Users basing on User taxonomy
- Modify function to only return values for the user that’s logged in
- loginout function customization
- User meta and public function security
- call wp_insert_user in custom class doesnt work
- Get users with different roles and call function on each of them (user_meta)
- Show errormessages on wrong username/password on custom loginform?
- How can I show different content for different user-levels?
- Custom user role still showing up after deletion, ideas?
- referencing the current user in a page i created in wordpress
- Show metadata in users.php – wordpress
- Render metabox gallery in frontend
- Deleting guests profile users after 1.5 hours
- wp_get_current_user return ID = 0 when used outside of wordpress, such as webhook / fulfillment dialogflow
- Allow user only create specific tags
- Add Change role button for list of user in an event
- get_current_user_id() always return 0 in if else statement
- Show users last read posts for each user?
- Frontend Feature image upload not work
- How to add number to wordpress count function?
- Add an ‘edit profile’ page with Genesis
- Function working in single.php but not working in custom template file
- get USER ID in functions.php using user_register action
- Code in functions.php appearing on front-end and dashboard [closed]
- How can i hide content if not friend in Buddypress? [closed]
- Whats the proper way to add a new user via a front end form?
- User profile in front-end
- sort by date in users
- Add custom css to specific user
- Send An Email to Admin on User Profile Completion
- Memorizing syntax
- Custom page with variables in url. Nice url with add_rewrite_rule
- Variable scope in WordPress functions.php
- what is the use of esc_attr() function?
- Pages should have priority when using add_rewrite_rule
- Setting cookies in WordPress
- How to display a default image for post thumbnail using functions.php?
- Product Tags in Add New product as checkbox list [closed]
- Frontend tag edit/submit form
- WordPress listen to $_POST in functions.php
- Add Element as a Filter to the_content
- issue with if/elseif in_array inside foreach loop display only one post
- Fail to get the total number of posts
- Output comment_author in array
- How to add class dynamically from templates
- How to change form action of wp-login page with a function
- Disabling user capability to edit_posts or delete_posts in the front-end
- Translation Function missing text-domain [closed]
- Custom taxonomy not refreshing page on add
- disable WP_error: authentication_failed
- Is mytheme_post_thumbnails() still necessary?
- Get full slug for a WordPress Post