bp_get_displayed_user_nav

Render the navigation markup for the displayed user.

Description

bp_get_displayed_user_nav(); 

Usage

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

Defined (1)

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

/bp-members/bp-members-template.php  
  1. function bp_get_displayed_user_nav() { 
  2. $bp =buddypress); 
  3.  
  4. foreach ( $bp->members->nav->get_primary() as $user_nav_item ) { 
  5. if ( empty( $user_nav_item->show_for_displayed_user ) && ! bp_is_my_profile() ) { 
  6. continue; 
  7.  
  8. $selected = ''; 
  9. if ( bp_is_current_component( $user_nav_item->slug ) ) { 
  10. $selected = ' class="current selected"'; 
  11.  
  12. $link = str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $user_nav_item->link ); 
  13. } else { 
  14. $link = trailingslashit( bp_displayed_user_domain() . $user_nav_item->link ); 
  15.  
  16. /** 
  17. * Filters the navigation markup for the displayed user. 
  18. * This is a dynamic filter that is dependent on the navigation tab component being rendered. 
  19. * @since 1.1.0 
  20. * @param string $value Markup for the tab list item including link. 
  21. * @param array $user_nav_item Array holding parts used to construct tab list item. 
  22. * Passed by reference. 
  23. */ 
  24. echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item->css_id, array( '<li id="' . $user_nav_item->css_id . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item->css_id . '" href="' . $link . '">' . $user_nav_item->name . '</a></li>', &$user_nav_item ) );