Changeset 9174
- Timestamp:
- 11/25/2014 02:51:59 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-friends/bp-friends-functions.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-functions.php
r9173 r9174 100 100 $friendship = new BP_Friends_Friendship( $friendship_id ); 101 101 102 /** 103 * Fires before the deletion of a friendship activity item 104 * for the user who canceled the friendship. 105 * 106 * @since BuddyPress (1.5.0) 107 * 108 * @param int $friendship_id ID of the friendship object, if any, between a pair of users. 109 * @param int $initiator_userid ID of the friendship initiator. 110 * @param int $friend_userid ID of the friend user. 111 */ 102 112 do_action( 'friends_before_friendship_delete', $friendship_id, $initiator_userid, $friend_userid ); 103 113 … … 105 115 friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => bp_displayed_user_id() ) ); 106 116 107 // This hook is misleadingly named - the friendship is not yet deleted. 108 // This is your last chance to do something while the friendship exists 117 /** 118 * Fires before the friendship connection is removed. 119 * 120 * This hook is misleadingly named - the friendship is not yet deleted. 121 * This is your last chance to do something while the friendship exists. 122 * 123 * @since BuddyPress (1.0.0) 124 * 125 * @param int $friendship_id ID of the friendship object, if any, between a pair of users. 126 * @param int $initiator_userid ID of the friendship initiator. 127 * @param int $friend_userid ID of the friend user. 128 */ 109 129 do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid ); 110 130 … … 112 132 friends_update_friend_totals( $initiator_userid, $friend_userid, 'remove' ); 113 133 134 /** 135 * Fires after the friendship connection is removed. 136 * 137 * @since BuddyPress (1.8.0) 138 * 139 * @param int $initiator_userid ID of the friendship initiator. 140 * @param int $friend_userid ID of the friend user. 141 */ 114 142 do_action( 'friends_friendship_post_delete', $initiator_userid, $friend_userid ); 115 143 … … 139 167 friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id ); 140 168 169 /** 170 * Fires after a friendship is accepted. 171 * 172 * @since BuddyPress (1.0.0) 173 * 174 * @param int $id ID of the pending friendship object. 175 * @param int $initiator_user_id ID of the friendship initiator. 176 * @param int $friend_user_id ID of the user requested friendship with. 177 * @param object $friendship BuddyPress Friendship Object. 178 */ 141 179 do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship ); 142 180 … … 157 195 158 196 if ( empty( $friendship->is_confirmed ) && BP_Friends_Friendship::reject( $friendship_id ) ) { 197 198 /** 199 * Fires after a friendship request is rejected. 200 * 201 * @since BuddyPress (1.0.0) 202 * 203 * @param int $friendship_id ID of the pending friendship. 204 * @param BP_Friends_Friendship $friendships Friendship object. Passed by reference. 205 */ 159 206 do_action_ref_array( 'friends_friendship_rejected', array( $friendship_id, &$friendship ) ); 160 207 return true; … … 181 228 do_action_ref_array( 'friends_friendship_whithdrawn', array( $friendship_id, &$friendship ) ); 182 229 183 // @since 1.9 230 /** 231 * Fires after a friendship request has been withdrawn. 232 * 233 * @since BuddyPress (1.9.0) 234 * 235 * @param int $friendship_id ID of the friendship. 236 * @param BP_Friends_Friendship $friendship Friendship object. Passed by reference. 237 */ 184 238 do_action_ref_array( 'friends_friendship_withdrawn', array( $friendship_id, &$friendship ) ); 185 239 … … 247 301 $count = 0; 248 302 303 /** 304 * Filters the total friend count for a given user. 305 * 306 * @since BuddyPress (1.2.0) 307 * 308 * @param int $count Total friend count for a given user. 309 */ 249 310 return apply_filters( 'friends_get_total_friend_count', $count ); 250 311 } … … 338 399 */ 339 400 function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filter = '' ) { 401 402 /** 403 * Filters a user's most recently active friends. 404 * 405 * @since BuddyPress (1.2.0) 406 * 407 * @param array { 408 * @type int $total_users Total number of users matched by query params. 409 * @type array $paged_users The current page of users matched by query params. 410 * } 411 */ 340 412 return apply_filters( 'friends_get_recently_active', BP_Core_User::get_users( 'active', $per_page, $page, $user_id, $filter ) ); 341 413 } … … 356 428 */ 357 429 function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter = '' ) { 430 431 /** 432 * Filters a user's friends listed in alphabetical order. 433 * 434 * @since BuddyPress (1.2.0) 435 * 436 * @return array { 437 * @type int $total_users Total number of users matched by query params. 438 * @type array $paged_users The current page of users matched by query params. 439 * } 440 */ 358 441 return apply_filters( 'friends_get_alphabetically', BP_Core_User::get_users( 'alphabetical', $per_page, $page, $user_id, $filter ) ); 359 442 } … … 374 457 */ 375 458 function friends_get_newest( $user_id, $per_page = 0, $page = 0, $filter = '' ) { 459 460 /** 461 * Filters a user's friends listed from newest to oldest. 462 * 463 * @since BuddyPress (1.2.0) 464 * 465 * @param array { 466 * @type int $total_users Total number of users matched by query params. 467 * @type array $paged_users The current page of users matched by query params. 468 * } 469 */ 376 470 return apply_filters( 'friends_get_newest', BP_Core_User::get_users( 'newest', $per_page, $page, $user_id, $filter ) ); 377 471 } … … 415 509 $friends = array(); 416 510 417 // Default args 511 /** 512 * Filters default arguments for list of friends a user can invite into this group. 513 * 514 * @since BuddyPress (1.5.4) 515 * 516 * @param array $value Array of default paremters for invite list. 517 */ 418 518 $args = apply_filters( 'bp_friends_pre_get_invite_list', array( 419 519 'user_id' => $user_id, … … 462 562 $friends = false; 463 563 464 // Allow friends to be filtered 564 /** 565 * Filters the list of potential friends that can be invited to this group. 566 * 567 * @since BuddyPress (1.5.4) 568 * 569 * @param array|bool $friends Array friends available to invite or false for no friends. 570 * @param int $user_id ID of the user checked for who they can invite. 571 * @param int $group_id ID of the group being checked on. 572 */ 465 573 return apply_filters( 'bp_friends_get_invite_list', $friends, $user_id, $group_id ); 466 574 } … … 567 675 function friends_remove_data( $user_id ) { 568 676 677 /** 678 * Fires before deletion of friend-related data for a given user. 679 * 680 * @since BuddyPress (1.5.0) 681 * 682 * @param int $user_id ID for the user whose friend data is being removed. 683 */ 569 684 do_action( 'friends_before_remove_data', $user_id ); 570 685 … … 574 689 bp_delete_user_meta( $user_id, 'total_friend_count' ); 575 690 691 /** 692 * Fires after deletion of friend-related data for a given user. 693 * 694 * @since BuddyPress (1.0.0) 695 * 696 * @param int $user_id ID for the user whose friend data is being removed. 697 */ 576 698 do_action( 'friends_remove_data', $user_id ); 577 699 }
Note: See TracChangeset
for help on using the changeset viewer.