bp_get_displayed_user

Get the displayed user Object.

Description

(object) bp_get_displayed_user(); 

Returns (object)

The displayed user object, null otherwise.


Usage

  1. if ( !function_exists( 'bp_get_displayed_user' ) ) { 
  2. require_once '/bp-members/bp-members-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_displayed_user(); 
  7.  

Defined (1)

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

/bp-members/bp-members-functions.php  
  1. function bp_get_displayed_user() { 
  2. $bp = buddypress(); 
  3.  
  4. $displayed_user = null; 
  5. if ( ! empty( $bp->displayed_user->id ) ) { 
  6. $displayed_user = $bp->displayed_user; 
  7.  
  8. /** 
  9. * Filters the displayed_user object corresponding to the displayed member. 
  10. * @since 2.6.0 
  11. * @param object $displayed_user The displayed_user object. 
  12. */ 
  13. return apply_filters( 'bp_get_displayed_user', $displayed_user );