Skip to:
Content

BuddyPress.org

Changeset 12179


Ignore:
Timestamp:
07/02/2018 05:18:56 PM (3 years ago)
Author:
imath
Message:

Members: give the last word to the BP_DEFAULT_COMPONENT constant

The default component defines the member's landing page. If this constant is defined and the corresponding component is active, it will set the component to load for this landing page, even if a custom front template is included into the site owner's theme.

Props sbrajesh, hnla, DJPaul

Fixes #7873

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r11940 r12179  
    233233        if ( bp_displayed_user_has_front_template() ) {
    234234            $bp->default_component = 'front';
    235         } elseif ( defined( 'BP_DEFAULT_COMPONENT' ) && BP_DEFAULT_COMPONENT ) {
    236             $bp->default_component = BP_DEFAULT_COMPONENT;
    237235        } elseif ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) {
    238236            $bp->default_component = bp_get_activity_slug();
    239237        } else {
    240238            $bp->default_component = ( 'xprofile' === $bp->profile->id ) ? 'profile' : $bp->profile->id;
     239        }
     240
     241        if ( defined( 'BP_DEFAULT_COMPONENT' ) && BP_DEFAULT_COMPONENT ) {
     242            $default_component = BP_DEFAULT_COMPONENT;
     243            if ( 'profile' === $default_component ) {
     244                $default_component = 'xprofile';
     245            }
     246
     247            if ( bp_is_active( $default_component ) ) {
     248                $bp->default_component = BP_DEFAULT_COMPONENT;
     249            }
    241250        }
    242251
Note: See TracChangeset for help on using the changeset viewer.