I am creating an author.php page and listing all the posts from an author. Although admins can see the posts' edit links i want to echo the link if logged in user is the current user
for example
if testuser is logged in and current page is /author/testuser he can see edit post links
but
if testuser is logged in and current page is /author/theee he cant see the links
currently i have
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
$th = $curauth->nickname;
$cu = $current_user->user_login;
if ( $th = $curauth ) {
edit_post_link('edit', '', '');
} else {
}
but still only admins can see the links.
edit_post_link()
? Then everything works as expected, for all users, at any level (Author, Editor, Administrator, etc).