Changeset 10323 for trunk/src/bp-friends/bp-friends-activity.php
- Timestamp:
- 11/02/2015 02:07:44 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-activity.php
r10147 r10323 91 91 $bp = buddypress(); 92 92 93 // These two added in BP 1.6 93 // These two added in BP 1.6. 94 94 bp_activity_set_action( 95 95 $bp->friends->id, … … 110 110 ); 111 111 112 // < BP 1.6 backpat 112 // < BP 1.6 backpat. 113 113 bp_activity_set_action( $bp->friends->id, 'friends_register_activity_action', __( 'New friendship created', 'buddypress' ) ); 114 114 … … 129 129 * @param string $action Activity action string. 130 130 * @param object $activity Activity data. 131 *132 131 * @return string $action Formatted activity action. 133 132 */ … … 140 139 // Backward compatibility for legacy filter 141 140 // The old filter has the $friendship object passed to it. We want to 142 // avoid having to build this object if it's not necessary 141 // avoid having to build this object if it's not necessary. 143 142 if ( has_filter( 'friends_activity_friendship_accepted_action' ) ) { 144 143 $friendship = new BP_Friends_Friendship( $activity->item_id ); … … 164 163 * @param string $action Static activity action. 165 164 * @param object $activity Activity data. 166 *167 165 * @return string $action Formatted activity action. 168 166 */ … … 175 173 // Backward compatibility for legacy filter 176 174 // The old filter has the $friendship object passed to it. We want to 177 // avoid having to build this object if it's not necessary 175 // avoid having to build this object if it's not necessary. 178 176 if ( has_filter( 'friends_activity_friendship_accepted_action' ) ) { 179 177 $friendship = new BP_Friends_Friendship( $activity->item_id ); … … 200 198 * 201 199 * @param array $activities Array of activity items. 202 *203 200 * @return array 204 201 */ … … 219 216 220 217 if ( ! empty( $friend_ids ) ) { 221 // Fire a user query to prime user caches 218 // Fire a user query to prime user caches. 222 219 new BP_User_Query( array( 223 220 'user_ids' => $friend_ids, … … 238 235 * @since 2.2.0 239 236 * 240 * @param array $retval Empty array by default 241 * @param array $filter Current activity arguments 242 * 237 * @param array $retval Empty array by default. 238 * @param array $filter Current activity arguments. 243 239 * @return array 244 240 */ 245 241 function bp_friends_filter_activity_scope( $retval = array(), $filter = array() ) { 246 242 247 // Determine the user_id 243 // Determine the user_id. 248 244 if ( ! empty( $filter['user_id'] ) ) { 249 245 $user_id = $filter['user_id']; … … 254 250 } 255 251 256 // Determine friends of user 252 // Determine friends of user. 257 253 $friends = friends_get_friend_user_ids( $user_id ); 258 254 if ( empty( $friends ) ) { … … 268 264 ), 269 265 270 // we should only be able to view sitewide activity content for friends266 // We should only be able to view sitewide activity content for friends. 271 267 array( 272 268 'column' => 'hide_sitewide', … … 274 270 ), 275 271 276 // overrides272 // Overrides. 277 273 'override' => array( 278 274 'filter' => array( 'user_id' => 0 ), … … 292 288 * @since 2.2.0 293 289 * 294 * @param array $retval Empty array by default 295 * @param array $filter Current activity arguments 290 * @param array $retval Empty array by default. 291 * @param array $filter Current activity arguments. 296 292 * 297 293 * @return array … … 299 295 function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = array() ) { 300 296 301 // Determine the user_id 297 // Determine the user_id. 302 298 if ( ! empty( $filter['user_id'] ) ) { 303 299 $user_id = $filter['user_id']; … … 308 304 } 309 305 310 // Get the requested action 306 // Get the requested action. 311 307 $action = $filter['filter']['action']; 312 308 313 // Make sure actions are listed in an array 309 // Make sure actions are listed in an array. 314 310 if ( ! is_array( $action ) ) { 315 311 $action = explode( ',', $filter['filter']['action'] ); … … 326 322 } 327 323 328 // Juggle existing override value 324 // Juggle existing override value. 329 325 $override = array(); 330 326 if ( ! empty( $retval['override'] ) ) { … … 354 350 ); 355 351 356 // Juggle back override value 352 // Juggle back override value. 357 353 if ( ! empty( $override ) ) { 358 354 $retval['override'] = $override; … … 369 365 * @since 1.9.0 370 366 * 371 * @param int $friendship_id 372 * @param int $initiator_user_id 373 * @param int $friend_user_id 374 * @param object|bool $friendship Optional 367 * @param int $friendship_id ID of the friendship. 368 * @param int $initiator_user_id ID of friendship initiator. 369 * @param int $friend_user_id ID of user whose friendship is requested. 370 * @param object|bool $friendship Optional Friendship object. 375 371 */ 376 372 function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) { … … 379 375 } 380 376 381 // Record in activity streams for the initiator 377 // Record in activity streams for the initiator. 382 378 friends_record_activity( array( 383 379 'user_id' => $initiator_user_id,
Note: See TracChangeset
for help on using the changeset viewer.