Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/26/2010 04:21:43 PM (14 years ago)
Author:
boonebgorges
Message:

Makes bp_has_activities() respect custom component slugs. Fixes #2588

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-templatetags.php

    r3480 r3485  
    133133}
    134134
     135/**
     136 * bp_has_activities()
     137 *
     138 * Initializes the activity loop.
     139 *
     140 * Based on the $args passed, bp_has_activities() populates the $activities_template global.
     141 *
     142 * @package BuddyPress Activity
     143 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     144 *
     145 * @param mixed $args Arguments for limiting the contents of the activity loop. Can be passed as an associative array or as a URL argument string
     146 * @return bool Returns true when activities are found
     147 */
    135148function bp_has_activities( $args = '' ) {
    136149    global $bp, $activities_template;
     
    149162    $primary_id = false;
    150163
    151     /* User filtering */
     164    // User filtering
    152165    if ( !empty( $bp->displayed_user->id ) )
    153166        $user_id = $bp->displayed_user->id;
    154167
    155     /* Group filtering */
     168    // Group filtering
    156169    if ( !empty( $bp->groups->current_group ) ) {
    157170        $object = $bp->groups->id;
     
    160173        if ( 'public' != $bp->groups->current_group->status && ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) || $bp->loggedin_user->is_super_admin ) )
    161174            $show_hidden = true;
     175    }
     176   
     177    // The default scope should recognize custom slugs
     178    if ( array_key_exists( $bp->current_action, (array)$bp->active_components ) ) {
     179        $scope = $bp->active_components[$bp->current_action];
     180    } else {
     181        $scope = $bp->current_action;
    162182    }
    163183
Note: See TracChangeset for help on using the changeset viewer.