Skip to:
Content

BuddyPress.org

Changeset 5559


Ignore:
Timestamp:
12/16/2011 03:35:54 PM (13 years ago)
Author:
boonebgorges
Message:

Fixes bp_core_new_nav_default() to work with the new canonical redirect. Fixes #3652

File:
1 edited

Legend:

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

    r5415 r5559  
    4444        'show_for_displayed_user' => $show_for_displayed_user,
    4545        'position'                => $position,
    46         'screen_function'         => &$screen_function
     46        'screen_function'         => &$screen_function,
     47        'default_subnav_slug'     => $default_subnav_slug
    4748    );
    4849
     
    118119    $bp->bp_nav[$parent_slug]['screen_function'] = &$screen_function;
    119120
     121    // If the current_action has been set to the default_subnav_slug, it will be reflected
     122    // in the redirect_stack. Unset the action manually so that the new nav default can be set
     123    if ( !empty( $bp->redirect_stack['action'] ) && $bp->redirect_stack['action'] == $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) {
     124        $bp->current_action = '';
     125    }
     126
    120127    if ( $bp->current_component == $parent_slug && !$bp->current_action ) {
    121128        if ( !is_object( $screen_function[0] ) )
     
    124131            add_action( 'bp_screens', array( &$screen_function[0], $screen_function[1] ) );
    125132
    126         if ( $subnav_slug )
    127             $bp->current_action = $subnav_slug;
     133        if ( $subnav_slug ) {
     134            $bp->current_action           = $subnav_slug;
     135            $bp->redirect_stack['action'] = $bp->current_action;
     136        }
    128137    }
    129138}
Note: See TracChangeset for help on using the changeset viewer.