Skip to:
Content

BuddyPress.org

Changeset 2946 for trunk/bp-core.php


Ignore:
Timestamp:
04/21/2010 11:34:12 AM (16 years ago)
Author:
apeatling
Message:

Merging 1.2 branch with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r2941 r2946  
    637637        'css_id' => $item_css_id,
    638638        'show_for_displayed_user' => $show_for_displayed_user,
    639         'position' => $position
     639        'position' => $position,
     640        'screen_function' => &$screen_function
    640641    );
    641642
     
    685686    $r = wp_parse_args( $args, $defaults );
    686687    extract( $r, EXTR_SKIP );
     688
     689    if ( $function = $bp->bp_nav[$parent_slug]['screen_function'] ) {
     690        if ( !is_object( $function[0] ) )
     691            remove_action( 'wp', $function, 3 );
     692        else
     693            remove_action( 'wp', array( &$function[0], $function[1] ), 3 );
     694    }
     695
     696    $bp->bp_nav[$parent_slug]['screen_function'] = &$screen_function;
    687697
    688698    if ( $bp->current_component == $parent_slug && !$bp->current_action ) {
     
    774784        'css_id' => $item_css_id,
    775785        'position' => $position,
    776         'user_has_access' => $user_has_access
     786        'user_has_access' => $user_has_access,
     787        'screen_function' => &$screen_function
    777788    );
    778789
     
    834845    }
    835846
     847    if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) {
     848        if ( !is_object( $function[0] ) )
     849            remove_action( 'wp', $function, 3 );
     850        else
     851            remove_action( 'wp', array( &$function[0], $function[1] ), 3 );
     852    }
     853
    836854    unset( $bp->bp_nav[$parent_id] );
    837855}
     
    849867    global $bp;
    850868
    851     $function = $bp->bp_options_nav[$parent_id][$slug]['screen_function'];
    852 
    853     if ( $function ) {
    854         if ( !is_object( $screen_function[0] ) )
    855             remove_action( 'wp', $screen_function, 3 );
     869    if ( $function = $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) {
     870        if ( !is_object( $function[0] ) )
     871            remove_action( 'wp', $function, 3 );
    856872        else
    857             remove_action( 'wp', array( &$screen_function[0], $screen_function[1] ), 3 );
     873            remove_action( 'wp', array( &$function[0], $function[1] ), 3 );
    858874    }
    859875
     
    18421858    wp_cache_flush();
    18431859}
    1844 add_action( 'wpmu_delete_user', 'bp_core_remove_data', 1 );
    1845 add_action( 'delete_user', 'bp_core_remove_data', 1 );
    1846 add_action( 'make_spam_user', 'bp_core_remove_data', 1 );
     1860add_action( 'wpmu_delete_user', 'bp_core_remove_data' );
     1861add_action( 'delete_user', 'bp_core_remove_data' );
     1862add_action( 'make_spam_user', 'bp_core_remove_data' );
    18471863
    18481864/**
Note: See TracChangeset for help on using the changeset viewer.