Skip to:
Content

BuddyPress.org

Changeset 4882


Ignore:
Timestamp:
07/28/2011 01:42:30 AM (15 years ago)
Author:
boonebgorges
Message:

Ensures that bp_is_current_component() checks against slugs as well as rot_slugs. Sets members default component to activity slug rather than to 'activity'. Fixes #3398, props r-a-y

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r4869 r4882  
    656656
    657657        if ( !empty( $bp->current_component ) ) {
    658 
    659658                // First, check to see whether $component_name and the current
    660659                // component are a simple match
     
    667666                        $is_current_component = true;
    668667
     668                // Because slugs can differ from root_slugs, we should check them too
     669                } elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) {
     670                        $is_current_component = true;
     671                       
    669672                // Next, check to see whether $component is a canonical,
    670673                // non-translatable component name. If so, we can return its
     
    674677                                $is_current_component = true;
    675678
    676                 // If we haven't found a match yet, check against the root_slugs
    677                 // created by $bp->pages
     679                // If we haven't found a match yet, check against the root_slugs 
     680                // created by $bp->pages, as well as the regular slugs
    678681                } else {
    679682                        foreach ( $bp->active_components as $key => $id ) {
  • trunk/bp-members/bp-members-loader.php

    r4824 r4882  
    110110                if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
    111111                        if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) )
    112                                 $bp->default_component = $bp->activity->id;
     112                                $bp->default_component = bp_get_activity_slug();
    113113                        else
    114114                                $bp->default_component = ( 'xprofile' == $bp->profile->id ) ? 'profile' : $bp->profile->id;
Note: See TracChangeset for help on using the changeset viewer.