Display if author page is author page of current user

in my multi author website I have a button that users can upload their avatars. I need to display this button in author page. I can do it. I added this button to author page. The problem is that author can see this button in other author's page too . That's why I need to display this button in author page of current user. I am so sorry I have no any reference code. I have no any idea how to do it. please help. Thank you for you attention. how to code that if current author page belongs to current user

Topic session author wp-query users archives Wordpress

Category Web


The is_author() conditional can be used to check if the query is targeting an author's page. By passing one or more User IDs/nicenames into it, it will check for specific author pages. So to check if the current author page is for the current user, it can be passed the return value from get_current_user_id():

if ( is_user_logged_in() && is_author( get_current_user_id() ) ){
  echo "belongs to current user ";
}
else {
  echo "not belongs to current user";
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.