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
- How can I add an extra WooCommerce hook
- automatically adding submenu items
- Functions.php: If its single?
- wp_link_pages: display current page number only if has multiple page breaks?
- Adjust which tempalte a page uses with a function?
- WordPress Content Security Policy and Subresource Integrity
- Shortcode pagination not advancing
- Commenter should see only his comments in wordpress
- translate the_title() with .po & .mo
- How can i disable auto save & revisions with `function.php` in wordpress?
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- How to construct function for applying filter?
- Best way to tell if a comment is from a user?
- Custom HTML markup
- How to create a shortcode out of a php function
- Only echo Page Content (not page title & page content together)
- How do I preserve changes to a theme’s functions.php across updates?
- Fetch URL parameter
- Updating custom query var with multiple values
- method to fetch entire tag list on archive.php
- MCAPI.class.php showing some error
- Sanitize html, where to sanitize
- How to display data from custom fields in my custom shortcode?
- function to return comma separated list of meta values