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
- custom user profiles like linktree fully customizable on the front end
- Add custom css to specific user
- Send An Email to Admin on User Profile Completion
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Need To Resize Images Exactly Without Losing Image Details
- Problem with shortcode inside a shortcode
- How to add or delete default value theme options while activate and deactivate theme
- Echo youtube code from url or shortcode
- Removing WPML Items From the WordPress Admin Bar
- Display ACF category image on archive and single template files
- Get URLs for AJAX Filter Checkboxes WordPress
- How to get taxonomy tree ids without running expensive loops
- Message notification for user
- Get slug of current category in functions.php
- wordpress built-in Jalali date convertor
- Disable autosave with `function.php` for custom post wordpress?
- sort metabox columns in listing Single
- WordPress login set cookie that survive browser exit (wp_signon function)
- wp_nav_menu displaying all pages
- WordPress 6.0 upgrade caused my custom function to stop working
- How to avoid saving empty data to sql while using add_meta_box
- How to assign php file(template) to several pages with same prefix page name/slug
- How to Display WooCommerce Product Price in WooCommerce Archive