bp_is_my_profile

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

Description

bp_is_my_profile(); 

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


Usage

  1. if ( !function_exists( 'bp_is_my_profile' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_is_my_profile(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-template.php  
  1. function bp_is_my_profile() { 
  2. if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() ) { 
  3. $my_profile = true; 
  4. } else { 
  5. $my_profile = false; 
  6.  
  7. /** 
  8. * Filters whether or not current page is part of the profile for the logged-in user. 
  9. * @since 1.2.4 
  10. * @param bool $my_profile Whether or not current page is part of the profile for the logged-in user. 
  11. */ 
  12. return apply_filters( 'bp_is_my_profile', $my_profile );