Skip to:
Content

BuddyPress.org

Ticket #3398: 3398.01.patch

File 3398.01.patch, 3.4 KB (added by r-a-y, 13 years ago)
  • bp-core/bp-core-template.php

    function bp_action_variables() { 
    494494 */
    495495function bp_action_variable( $position = 0 ) {
    496496        $action_variables = bp_action_variables();
    497        
     497
    498498        $action_variable = isset( $action_variables[$position] ) ? $action_variables[$position] : false;
    499        
     499
    500500        return apply_filters( 'bp_action_variable', $action_variable, $position );
    501501}
    502502
    function bp_is_current_action( $action = '' ) { 
    748748 * @param int $position The array key you're testing against. If you don't provide a $position,
    749749 *   the function will return true if the $action_variable is found *anywhere* in the action
    750750 *   variables array.
    751  * @return bool 
     751 * @return bool
    752752 */
    753753function bp_is_action_variable( $action_variable = '', $position = false ) {
    754754        $is_action_variable = false;
    755        
     755
    756756        if ( false !== $position ) {
    757                 // When a $position is specified, check that slot in the action_variables array         
     757                // When a $position is specified, check that slot in the action_variables array
    758758                if ( $action_variable ) {
    759759                        $is_action_variable = $action_variable == bp_action_variable( $position );
    760760                } else {
    function bp_is_action_variable( $action_variable = '', $position = false ) { 
    766766                // When no $position is specified, check the entire array
    767767                $is_action_variable = in_array( $action_variable, (array)bp_action_variables() );
    768768        }
    769        
     769
    770770        return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position );
    771771}
    772772
    function bp_is_directory() { 
    825825 */
    826826function bp_is_root_component( $component_name ) {
    827827        global $bp;
    828        
     828
    829829        if ( !isset( $bp->active_components ) )
    830830                return false;
    831831
    function bp_is_profile_component() { 
    912912}
    913913
    914914function bp_is_activity_component() {
    915         if ( bp_is_current_component( 'activity' ) )
     915        if ( bp_is_current_component( 'activity' ) || bp_is_current_component( bp_get_activity_slug() ) )
    916916                return true;
    917917
    918918        return false;
    function bp_is_settings_component() { 
    966966function bp_is_single_activity() {
    967967        global $bp;
    968968
    969         if ( bp_is_current_component( 'activity' ) && is_numeric( $bp->current_action ) )
     969        if ( bp_is_activity_component() && is_numeric( $bp->current_action ) )
    970970                return true;
    971971
    972972        return false;
    function bp_is_user() { 
    997997function bp_is_user_activity() {
    998998        global $bp;
    999999
    1000         if ( bp_is_current_component( 'activity' ) )
     1000        if ( bp_is_activity_component() )
    10011001                return true;
    10021002
    10031003        return false;
    function bp_is_user_profile_edit() { 
    10261026
    10271027        if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'edit' ) )
    10281028                return true;
    1029                
     1029
    10301030        return false;
    10311031}
    10321032
  • bp-members/bp-members-loader.php

    class BP_Members_Component extends BP_Component { 
    109109                /** Default Profile Component *****************************************/
    110110                if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
    111111                        if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) )
    112                                 $bp->default_component = $bp->activity->id;
     112                                $bp->default_component = bp_get_activity_slug();
    113113                        else
    114114                                $bp->default_component = ( 'xprofile' == $bp->profile->id ) ? 'profile' : $bp->profile->id;
    115115