I’m trying to figure out how to link a logged-in user to his profile settings, but I can’t seem to find a function that generates this link (like wp_settings_url()
or wp_profile_url()
)
Is there a default function for this?
Leave a Reply
You must be logged in to post a comment.
The user edit page of the current user is
/wp-admin/profile.php
, so you can just doadmin_url( 'profile.php' )
, which is the way it is used in the WP source code.Combination of other answers:
I’m using this on author.php, that’s why I’ve already got the user ID on the page. That way an admin gets a link to edit that user’s profile rather than their own.
Possibly something like this?
If you’re only interested in the current user, use get_edit_profile_url():
If you want to display a link to another user’s profile, use get_edit_user_link():
This is the Correct way! Please use this for user profile link.