Changeset 13092 for trunk/src/bp-friends/bp-friends-activity.php
- Timestamp:
- 08/24/2021 04:16:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-activity.php
r12602 r13092 50 50 'secondary_item_id' => false, 51 51 'recorded_time' => bp_core_current_time(), 52 'hide_sitewide' => false 52 'hide_sitewide' => false, 53 53 ) ); 54 54 … … 70 70 * @type int $user_id ID of the user associated with the activity item. 71 71 * } 72 * @return bool True on success, false on failure.73 72 */ 74 73 function friends_delete_activity( $args ) { … … 81 80 'item_id' => $args['item_id'], 82 81 'type' => $args['type'], 83 'user_id' => $args['user_id'] 82 'user_id' => $args['user_id'], 84 83 ) ); 85 84 } … … 89 88 * 90 89 * @since 1.1.0 90 * 91 * @return bool False if activity component is not active. 91 92 */ 92 93 function friends_register_activity_actions() { 93 94 94 if ( ! bp_is_active( 'activity' ) ) {95 if ( ! bp_is_active( 'activity' ) ) { 95 96 return false; 96 97 } … … 136 137 * @param string $action Activity action string. 137 138 * @param object $activity Activity data. 138 * @return string $actionFormatted activity action.139 * @return string Formatted activity action. 139 140 */ 140 141 function bp_friends_format_activity_action_friendship_accepted( $action, $activity ) { … … 171 172 * @param string $action Static activity action. 172 173 * @param object $activity Activity data. 173 * @return string $actionFormatted activity action.174 * @return string Formatted activity action. 174 175 */ 175 176 function bp_friends_format_activity_action_friendship_created( $action, $activity ) { … … 270 271 'column' => 'user_id', 271 272 'compare' => 'IN', 272 'value' => (array) $friends 273 'value' => (array) $friends, 273 274 ), 274 275 … … 276 277 array( 277 278 'column' => 'hide_sitewide', 278 'value' => 0 279 'value' => 0, 279 280 ), 280 281 … … 282 283 'override' => array( 283 284 'filter' => array( 'user_id' => 0 ), 284 'show_hidden' => true 285 'show_hidden' => true, 285 286 ), 286 287 ); … … 355 356 'value' => $user_id, 356 357 ), 357 ) 358 ), 358 359 ); 359 360 … … 373 374 * @since 1.9.0 374 375 * 375 * @param int $friendship_id ID of the friendship. 376 * @param int $initiator_user_id ID of friendship initiator. 377 * @param int $friend_user_id ID of user whose friendship is requested. 378 * @param object|bool $friendship Optional Friendship object. 379 */ 380 function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) { 376 * @param int $friendship_id ID of the friendship. 377 * @param int $initiator_user_id ID of friendship initiator. 378 * @param int $friend_user_id ID of user whose friendship is requested. 379 */ 380 function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id ) { 381 381 if ( ! bp_is_active( 'activity' ) ) { 382 382 return; … … 388 388 'type' => 'friendship_created', 389 389 'item_id' => $friendship_id, 390 'secondary_item_id' => $friend_user_id 390 'secondary_item_id' => $friend_user_id, 391 391 ) ); 392 392 } 393 add_action( 'friends_friendship_accepted', 'bp_friends_friendship_accepted_activity', 10, 4);393 add_action( 'friends_friendship_accepted', 'bp_friends_friendship_accepted_activity', 10, 3 ); 394 394 395 395 /** … … 405 405 } 406 406 407 bp_activity_delete( array( 408 'component' => buddypress()->friends->id, 409 'type' => 'friendship_created', 410 'secondary_item_id' => $user_id 411 ) ); 407 bp_activity_delete( 408 array( 409 'component' => buddypress()->friends->id, 410 'type' => 'friendship_created', 411 'secondary_item_id' => $user_id, 412 ) 413 ); 412 414 } 413 415 add_action( 'friends_remove_data', 'bp_friends_delete_activity_on_user_delete' ); … … 421 423 */ 422 424 function bp_friends_delete_activity_on_friendship_delete( $friendship_id ) { 423 friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_created', 'user_id' => 0 ) ); 425 friends_delete_activity( 426 array( 427 'item_id' => $friendship_id, 428 'type' => 'friendship_created', 429 'user_id' => 0, 430 ) 431 ); 424 432 } 425 433 add_action( 'friends_friendship_deleted', 'bp_friends_delete_activity_on_friendship_delete' );
Note: See TracChangeset
for help on using the changeset viewer.