Skip to:
Content

BuddyPress.org

Changeset 1982 for trunk/bp-core.php


Ignore:
Timestamp:
09/28/2009 10:49:53 PM (16 years ago)
Author:
apeatling
Message:

Fixes #1096 props messenlehner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1980 r1982  
    572572 */
    573573function bp_core_get_displayed_userid( $user_login ) {
    574     return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid_from_user_login( $user_login ) );
     574    return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid( $user_login ) );
    575575}
    576576
     
    584584 */
    585585function bp_core_new_nav_item( $args = '' ) {
    586     global $bp, $temp_nav;
    587 
    588     $temp_nav[] = $args;
    589    
     586    global $bp;
     587
    590588    $defaults = array(
    591589        'name' => false, // Display name for the nav item
     
    639637}
    640638
     639/**
     640 * bp_core_new_nav_default()
     641 *
     642 * Modify the default subnav item to load when a top level nav item is clicked.
     643 *
     644 * @package BuddyPress Core
     645 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     646 */
     647function bp_core_new_nav_default( $args = '' ) {
     648    global $bp;
     649   
     650    $defaults = array(
     651        'parent_slug' => false, // Slug of the parent
     652        'screen_function' => false, // The name of the function to run when clicked
     653        'subnav_slug' => false // The slug of the subnav item to select when clicked
     654    );
     655
     656    $r = wp_parse_args( $args, $defaults );
     657    extract( $r, EXTR_SKIP );
     658
     659    if ( $bp->current_component == $parent_slug && !$bp->current_action ) {
     660        if ( !is_object( $screen_function[0] ) )
     661            add_action( 'wp', $screen_function, 3 );
     662        else
     663            add_action( 'wp', array( &$screen_function[0], $screen_function[1] ), 3 );
     664
     665        if ( $subnav_slug )
     666            $bp->current_action = $subnav_slug;
     667    }
     668}
    641669
    642670/**
Note: See TracChangeset for help on using the changeset viewer.