This function has been deprecated. Does not seem to be called anywhere in BP core instead.
bp_get_loggedin_user_nav()
Render the navigation markup for the logged-in user.
Description
Each component adds to this navigation array within its own [component_name]setup_nav() function.
This navigation array is the top level navigation, so it contains items such as: [Blog, Profile, Messages, Groups, Connections] …
The function will also analyze the current component the user is in, to determine whether or not to highlight a particular nav item.
Source
File: bp-members/bp-members-template.php
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 | function bp_get_loggedin_user_nav() { $bp = buddypress(); // Loop through each navigation item. foreach ( ( array ) $bp ->members->nav->get_primary() as $nav_item ) { $selected = '' ; // If the current component matches the nav item id, then add a highlight CSS class. if ( ! bp_is_directory() && ! empty ( $bp ->active_components[ bp_current_component() ] ) && $bp ->active_components[ bp_current_component() ] == $nav_item ->css_id ) { $selected = ' class="current selected"' ; } // If we are viewing another person (current_userid does not equal // loggedin_user->id then check to see if the two users are friends. // if they are, add a highlight CSS class to the friends nav item // if it exists. if ( !bp_is_my_profile() && bp_displayed_user_id() ) { $selected = '' ; if ( bp_is_active( 'friends' ) ) { if ( $nav_item ->css_id == $bp ->friends->id ) { if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { $selected = ' class="current selected"' ; } } } } // Echo out the final list item. echo apply_filters_ref_array( 'bp_get_loggedin_user_nav_' . $nav_item ->css_id, array ( '<li id="li-nav-' . $nav_item ->css_id . '" ' . $selected . '><a id="my-' . $nav_item ->css_id . '" href="' . $nav_item ->link . '">' . $nav_item ->name . '</a></li>' , & $nav_item ) ); } // Always add a log out list item to the end of the navigation. $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_domain() ) . '">' . __( 'Log Out' , 'buddyboss' ) . '</a></li>' ; echo apply_filters( 'bp_logout_nav_link' , $logout_link ); } |
Changelog
Version | Description |
---|---|
BuddyPress 1.1.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.