bp_is_my_profile()

Is the current page part of the profile of the logged-in user?

Description

Will return true for any subpage of the logged-in user’s profile, eg http://example.com/members/joe/friends/.

Return

(bool) True if the current page is part of the profile of the logged-in user.

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 BuddyPress 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
BuddyPress 1.2.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.