Content areas in author page only visible to author...?


I am trying to make specific parts of an interface public and non-public. More specifically, non-public in the sense that only the author can view certain areas of their profile / author page. Otherwise it is just not visible.

Here is the code I thought would work, but I can still see the content 2 tabs if I am logged in as someone else.

please see code excerpt below:

<?php $currentuser = get_currentuserinfo(); ?>
<?php if ( get_the_author() == $currentuser->displayname ) {?>
     // current user = authorpage owner
<li><a href="#tab1">tab1</a></li>
<li><a href="#tab2">tab2</a></li>
<?php }?>