Changeset 9257 for trunk/src/bp-groups/bp-groups-activity.php
- Timestamp:
- 12/22/2014 09:46:50 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-activity.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-activity.php
r9204 r9257 235 235 236 236 /** 237 * Set up activity arguments for use with the 'groups' scope. 238 * 239 * @since BuddyPress (2.2.0) 240 * 241 * @param array $retval Empty array by default 242 * @param array $filter Current activity arguments 243 * @return array 244 */ 245 function bp_groups_filter_activity_scope( $retval, $filter ) { 246 $groups = groups_get_user_groups( $filter['user_id'] ); 247 248 if ( empty( $groups['groups'] ) ) { 249 return $retval; 250 } 251 252 $retval= array( 253 'relation' => 'AND', 254 array( 255 'column' => 'component', 256 'value' => buddypress()->groups->id 257 ), 258 array( 259 'column' => 'item_id', 260 'compare' => 'IN', 261 'value' => (array) $groups['groups'] 262 ), 263 ); 264 265 // wipe out the user ID 266 $retval['override']['filter']['user_id'] = 0; 267 268 return $retval; 269 } 270 add_filter( 'bp_activity_set_groups_scope_args', 'bp_groups_filter_activity_scope', 10, 2 ); 271 272 /** 237 273 * Record an activity item related to the Groups component. 238 274 *
Note: See TracChangeset
for help on using the changeset viewer.