Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/12/2011 02:39:11 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Audit the usage of $bp->groups->slug. See #3325.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-actions.php

    r4524 r4648  
    1414
    1515    // If we're not at domain.org/groups/create/ then return false
    16     if ( !bp_is_current_component( 'groups' ) || !bp_is_current_action( 'create' ) )
     16    if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
    1717        return false;
    1818
     
    199199    global $bp;
    200200
    201     if ( !bp_is_single_item() || !bp_is_current_component( 'groups' ) || !bp_is_current_action( 'join' ) )
     201    if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'join' ) )
    202202        return false;
    203203
     
    234234    global $bp;
    235235
    236     if ( !bp_is_single_item() || !bp_is_current_component( 'groups' ) || !bp_is_current_action( 'leave-group' ) )
     236    if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'leave-group' ) )
    237237        return false;
    238238
     
    259259    global $bp;
    260260
    261     if ( !bp_is_current_component( 'groups' ) || !bp_is_current_action( 'create' ) )
     261    if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
    262262        return false;
    263263
     
    283283    global $bp, $wpdb;
    284284
    285     if ( bp_is_current_component( $bp->groups->slug ) && isset( $_GET['random-group'] ) ) {
     285    if ( bp_is_groups_component() && isset( $_GET['random-group'] ) ) {
    286286        $group = groups_get_groups( array( 'type' => 'random', 'per_page' => 1 ) );
    287287
    288         bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->slug . '/' . $group['groups'][0]->slug . '/' );
     288        bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group['groups'][0]->slug . '/' );
    289289    }
    290290}
     
    294294    global $bp, $wp_query;
    295295
    296     if ( !bp_is_active( 'activity' ) || !bp_is_current_component( 'groups' ) || !isset( $bp->groups->current_group ) || !bp_is_current_action( 'feed' ) )
     296    if ( !bp_is_active( 'activity' ) || !bp_is_groups_component() || !isset( $bp->groups->current_group ) || !bp_is_current_action( 'feed' ) )
    297297        return false;
    298298
Note: See TracChangeset for help on using the changeset viewer.