Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/27/2009 09:18:10 PM (17 years ago)
Author:
apeatling
Message:

Fixes #723

File:
1 edited

Legend:

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

    r1655 r1718  
    940940}
    941941
     942/* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() */
     943function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) {
     944        global $bp;
     945       
     946        if ( !$user_has_access && !bp_is_home() )
     947                return false;
     948               
     949        if ( $admin_only && !is_site_admin() )
     950                return false;
     951
     952        if ( $bp->current_component == $parent_id && !$bp->current_action ) {
     953                if ( function_exists($function) ) {
     954                        add_action( 'wp', $function, 3 );
     955                }
     956               
     957                if ( $slug )
     958                        $bp->current_action = $slug;
     959        }
     960}
     961
Note: See TracChangeset for help on using the changeset viewer.