Skip to:
Content

bbPress.org

Ticket #2594: 2594.diff

File 2594.diff, 1.3 KB (added by tharsheblows, 10 years ago)

check that subs and faves are active before including in bp profiles

  • src/includes/extend/buddypress/loader.php

     
    218218                );
    219219
    220220                // Favorite topics
    221                 $sub_nav[] = array(
    222                         'name'            => __( 'Favorites', 'bbpress' ),
    223                         'slug'            => bbp_get_user_favorites_slug(),
    224                         'parent_url'      => $forums_link,
    225                         'parent_slug'     => $this->slug,
    226                         'screen_function' => 'bbp_member_forums_screen_favorites',
    227                         'position'        => 60,
    228                         'item_css_id'     => 'favorites'
    229                 );
     221                if ( bbp_is_favorites_active() ){
     222                        $sub_nav[] = array(
     223                                'name'            => __( 'Favorites', 'bbpress' ),
     224                                'slug'            => bbp_get_user_favorites_slug(),
     225                                'parent_url'      => $forums_link,
     226                                'parent_slug'     => $this->slug,
     227                                'screen_function' => 'bbp_member_forums_screen_favorites',
     228                                'position'        => 60,
     229                                'item_css_id'     => 'favorites'
     230                        );
     231                }
    230232
    231233                // Subscribed topics (my profile only)
    232                 if ( bp_is_my_profile() ) {
     234                if ( bp_is_my_profile() && bbp_is_subscriptions_active() ) {
    233235                        $sub_nav[] = array(
    234236                                'name'            => __( 'Subscriptions', 'bbpress' ),
    235237                                'slug'            => bbp_get_user_subscriptions_slug(),