Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/01/2011 07:53:50 PM (16 years ago)
Author:
johnjamesjacoby
Message:

Use bp_current_item() in place of $bp->current_item global

File:
1 edited

Legend:

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

    r3982 r3983  
    543543function bp_current_action() {
    544544        global $bp;
    545         return apply_filters( 'bp_current_action', $bp->current_action );
     545        $current_action = !empty( $bp->current_action ) ? $bp->current_action : false;
     546        return apply_filters( 'bp_current_action', $current_action );
    546547}
    547548
    548549function bp_current_item() {
    549550        global $bp;
    550         return apply_filters( 'bp_current_item', $bp->current_item );
     551        $current_item = !empty( $bp->current_item ) ? $bp->current_item : false;
     552        return apply_filters( 'bp_current_item', $current_item );
    551553}
    552554
    553555function bp_action_variables() {
    554556        global $bp;
    555         return apply_filters( 'bp_action_variables', $bp->action_variables );
     557        $action_variables = !empty( $bp->action_variables ) ? $bp->action_variables : false;
     558        return apply_filters( 'bp_action_variables', $action_variables );
    556559}
    557560
    … …  
    738741
    739742function bp_is_current_item( $item = '' ) {
    740         global $bp;
    741 
    742         if ( $item == $bp->current_item )
     743        if ( !empty( $item ) && $item == bp_current_item() )
    743744                return true;
    744745
Note: See TracChangeset for help on using the changeset viewer.