Skip to:
Content

BuddyPress.org

Changeset 4195


Ignore:
Timestamp:
04/10/2011 12:00:30 PM (14 years ago)
Author:
djpaul
Message:

Don't show forum tab in user profile navigation if the forums are not set up (fixes PHP notices)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-loader.php

    r4154 r4195  
    9595        global $bp;
    9696
     97        // Stop if forums haven't been set up yet
     98        if ( !bp_forums_is_installed_correctly() )
     99            return;
     100
     101        // Stop if there is no user displayed or logged in
     102        if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
     103            return;
     104       
    97105        // Add 'Forums' to the main navigation
    98106        $main_nav = array(
     
    104112            'item_css_id'         => $this->id
    105113        );
    106 
    107         // Stop if there is no user displayed or logged in
    108         if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
    109             return;
    110114
    111115        // Determine user to use
Note: See TracChangeset for help on using the changeset viewer.