As of now i’m using this code to echo user’s profile url.
<?php echo esc_url( home_url( '/' ) ); ?>user/<?php echo $current_user->user_login ?>"><?php echo $current_user->user_login ?></a>
This link uses author base as “user”. So when i change author base this link will be broken.
IS there any function available like current_user_profile_link()
?
Choosing the right template
As your “User Profile”-Page is something completely custom and not the admin UI user profile page, I’d suggest to take the uthor posts page instead:
Then modify this template.
Pretty URls
No need to go outside the WP template hierarchy. If you want something like
~/user
, then use theRewrite API
.( Update )
get_author_link()
This function has been deprecated. Useget_author_posts_url()
instead.Example
https://codex.wordpress.org/Function_Reference/get_author_posts_url
From Kaiser answer, get_author_link function is deprecated
So please try to use get_author_posts_url()