[Resolved] Hide profile if not profile-owner
-
I have googled and searched this forum, and tried different types of codes. But nothing works well. Most of the examples given are several years old. So I hope to work it out by posting this question instead.
I would like to hide the members profile by using if statement where it checks if the person visiting a profile is the profile-owner or not.
A few of the codes I have tried (I also tried some functions-ones) are:
<?php if ( bp_is_my_profile() == 1 ) { echo 'yes'; } else { echo 'no'; } ?>
<?php global $bp; $current_user_id = (int) trim($bp->loggedin_user->id); $author_id = (int) trim($bp->displayed_user->id); if ($current_user_id !== $author_id) :?> no <?php else : ?> yes <?php endif; ?>
Both of the examples give out the same echo on both being logged in and at my own profile, and for being logged out. So it’s not doing what I’d like it to do. :/
- The topic ‘[Resolved] Hide profile if not profile-owner’ is closed to new replies.