Skip to:
Content

BuddyPress.org


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

File:
1 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 ) {
Note: See TracChangeset for help on using the changeset viewer.