Changeset 9406 for trunk/src/bp-groups/bp-groups-activity.php
- Timestamp:
- 01/28/2015 10:50:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-activity.php
r9372 r9406 243 243 * @return array 244 244 */ 245 function bp_groups_filter_activity_scope( $retval, $filter ) { 246 $groups = groups_get_user_groups( $filter['user_id'] ); 247 245 function bp_groups_filter_activity_scope( $retval = array(), $filter = array() ) { 246 247 // Determine the user_id 248 if ( ! empty( $filter['user_id'] ) ) { 249 $user_id = $filter['user_id']; 250 } else { 251 $user_id = bp_displayed_user_id() 252 ? bp_displayed_user_id() 253 : bp_loggedin_user_id(); 254 } 255 256 // Determine groups of user 257 $groups = groups_get_user_groups( $user_id ); 248 258 if ( empty( $groups['groups'] ) ) { 249 259 $groups = array( 'groups' => 0 ); 250 260 } 251 261 252 $retval= array( 262 // Should we show all items regardless of sitewide visibility? 263 $show_hidden = array(); 264 if ( ! empty( $user_id ) && ( $user_id !== bp_loggedin_user_id() ) ) { 265 $show_hidden = array( 266 'column' => 'hide_sitewide', 267 'value' => 0 268 ); 269 } 270 271 $retval = array( 253 272 'relation' => 'AND', 254 273 array( 255 'column' => 'component', 256 'value' => buddypress()->groups->id 274 'relation' => 'AND', 275 array( 276 'column' => 'component', 277 'value' => buddypress()->groups->id 278 ), 279 array( 280 'column' => 'item_id', 281 'compare' => 'IN', 282 'value' => (array) $groups['groups'] 283 ), 257 284 ), 258 array( 259 'column' => 'item_id', 260 'compare' => 'IN', 261 'value' => (array) $groups['groups'] 285 $show_hidden, 286 287 // overrides 288 'override' => array( 289 'filter' => array( 'user_id' => 0 ), 290 'show_hidden' => true 262 291 ), 263 292 ); 264 265 // wipe out the user ID266 $retval['override']['filter']['user_id'] = 0;267 293 268 294 return $retval;
Note: See TracChangeset
for help on using the changeset viewer.