Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.1k views
in Q2A Core by
Ok i think that i am very closed to find a solution for that but i cant figure it out how :(
What i want to do is to add a simple link at user's profile page that will be only visible to the owners of that page.

I already overrided the function profile_page and i can display what i want to the profile page but i cant find what is the functions that checks if the logged in user is the owner of profile page or not

To be more detailed i need a function to do something like that :

If  (the_logged_in_user_is_the_owner_of_the_profile) {

<a href="#">LINK GOES HERE</a> //Display the link

}
Q2A version: 1.6.x
by
What page are you editing?
by
Profile Page

1 Answer

0 votes
by
selected by
 
Best answer

If dealing with qa-include//pages/user.php, this is what I tested:

grab part of the url request that opens the profile and check it against the logged in username

if (qa_request_part(1) == qa_get_logged_in_handle()) {
  //do stuff here
}

by
i am trying to add the code inside my qa-theme.php file as there i overrided the function profile_page.

Thanks
by
That piece of code should work anywhere in your qa-theme.php
by
You are the best. It works fine! Your answer voted as best :)
by
Awesome! glad it worked out.
...