bp_is_my_profile()
Is the current page part of the profile of the logged-in user?
Description Description
Will return true for any subpage of the logged-in user’s profile, eg http://example.com/members/joe/friends/.
Return Return
(bool) True if the current page is part of the profile of the logged-in user.
Source Source
File: bp-core/bp-core-template.php
function bp_is_my_profile() {
if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() ) {
$my_profile = true;
} else {
$my_profile = false;
}
/**
* Filters whether or not current page is part of the profile for the logged-in user.
*
* @since 1.2.4
*
* @param bool $my_profile Whether or not current page is part of the profile for the logged-in user.
*/
return apply_filters( 'bp_is_my_profile', $my_profile );
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.2.0 | Introduced. |