Skip to content

Commit

Permalink
Avoid unnecessary query.
Browse files Browse the repository at this point in the history
  • Loading branch information
boonebgorges committed Nov 8, 2018
1 parent 6aff087 commit bad50e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/user-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
* @return bool
*/
public function change_tab_visibility() {
// Don't bother with query if there's no user.
if ( ! bp_displayed_user_id() ) {
return;
}

if ( class_exists( 'BP_Core_Nav' ) ) {
buddypress()->members->nav->edit_nav( array(
'show_for_displayed_user' => $this->user_has_tools( bp_displayed_user_id() ),
Expand Down

0 comments on commit bad50e0

Please sign in to comment.