Changeset 9257 for trunk/src/bp-friends/bp-friends-activity.php
- Timestamp:
- 12/22/2014 09:46:50 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-friends/bp-friends-activity.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-activity.php
r9154 r9257 229 229 230 230 /** 231 * Set up activity arguments for use with the 'friends' scope. 232 * 233 * For details on the syntax, see {@link BP_Activity_Query}. 234 * 235 * @since BuddyPress (2.2.0) 236 * 237 * @param array $retval Empty array by default 238 * @param array $filter Current activity arguments 239 * @return array 240 */ 241 function bp_friends_filter_activity_scope( $retval, $filter ) { 242 $friends = friends_get_friend_user_ids( $filter['user_id'] ); 243 244 if ( empty( $friends ) ) { 245 return $retval; 246 } 247 248 $retval= array( 249 'relation' => 'AND', 250 array( 251 'column' => 'user_id', 252 'compare' => 'IN', 253 'value' => (array) $friends 254 ), 255 // we should only be able to view sitewide activity content for friends 256 array( 257 'column' => 'hide_sitewide', 258 'value' => 0 259 ), 260 ); 261 262 // wipe out the user ID 263 $retval['override']['filter']['user_id'] = 0; 264 265 // make sure we aren't limiting items by 'hide_sitewide' since we're already 266 // limiting it above 267 $scope_args['override']['show_hidden'] = true; 268 269 return $retval; 270 } 271 add_filter( 'bp_activity_set_friends_scope_args', 'bp_friends_filter_activity_scope', 10, 2 ); 272 273 /** 231 274 * Add activity stream items when one members accepts another members request 232 275 * for virtual friendship.
Note: See TracChangeset
for help on using the changeset viewer.