Changeset 9995
- Timestamp:
- 07/04/2015 10:23:19 PM (9 years ago)
- Location:
- trunk/src/bp-friends
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-actions.php
r9819 r9995 2 2 3 3 /** 4 * BuddyPress Friends Actions 4 * BuddyPress Friends Actions. 5 5 * 6 6 * Action functions are exactly the same as screen functions, however they do -
trunk/src/bp-friends/bp-friends-activity.php
r9819 r9995 2 2 3 3 /** 4 * BuddyPress Friends Activity Functions 4 * BuddyPress Friends Activity Functions. 5 5 * 6 6 * These functions handle the recording, deleting and formatting of activity … … 23 23 * return values. 24 24 * 25 * @param array $args {25 * @param array|string $args { 26 26 * An array of arguments for the new activity item. Accepts all parameters 27 27 * of {@link bp_activity_add()}. The one difference is the following 28 28 * argument, which has a different default here: 29 29 * @type string $component Default: the id of your Friends component 30 * (usually 'friends').30 * (usually 'friends'). 31 31 * } 32 32 * @return bool See {@link bp_activity_add()}. … … 59 59 * @param array $args { 60 60 * An array of arguments for the item to delete. 61 * @type int $item_id ID of the 'item' associated with the activity item.62 * For Friends activity items, this is usually the user ID of one63 * of the friends.64 * @type string $type The 'type' of the activity item (eg65 * 'friendship_accepted').66 * @type int $user_id ID of the user associated with the activity item.61 * @type int $item_id ID of the 'item' associated with the activity item. 62 * For Friends activity items, this is usually the user ID of one 63 * of the friends. 64 * @type string $type The 'type' of the activity item (eg 65 * 'friendship_accepted'). 66 * @type int $user_id ID of the user associated with the activity item. 67 67 * } 68 68 * @return bool True on success, false on failure. … … 128 128 * @since BuddyPress (2.0.0) 129 129 * 130 * @param string $action Activity action string. 130 131 * @param object $activity Activity data. 132 * 131 133 * @return string $action Formatted activity action. 132 134 */ … … 150 152 * @since BuddyPress (2.0.0) 151 153 * 152 * @param string $action String text for the 'friendship_accepted' action.154 * @param string $action String text for the 'friendship_accepted' action. 153 155 * @param object $activity Activity data. 154 156 */ … … 161 163 * @since BuddyPress (2.0.0) 162 164 * 163 * @param string $action Static activity action.165 * @param string $action Static activity action. 164 166 * @param object $activity Activity data. 167 * 165 168 * @return string $action Formatted activity action. 166 169 */ … … 184 187 * @since BuddyPress (2.0.0) 185 188 * 186 * @param string $action String text for the 'friendship_created' action.189 * @param string $action String text for the 'friendship_created' action. 187 190 * @param object $activity Activity data. 188 191 */ … … 198 201 * 199 202 * @param array $activities Array of activity items. 203 * 200 204 * @return array 201 205 */ … … 237 241 * @param array $retval Empty array by default 238 242 * @param array $filter Current activity arguments 243 * 239 244 * @return array 240 245 */ … … 290 295 * @param array $retval Empty array by default 291 296 * @param array $filter Current activity arguments 297 * 292 298 * @return array 293 299 */ … … 364 370 * @since BuddyPress (1.9.0) 365 371 * 366 * @param int $friendship_id367 * @param int $initiator_user_id368 * @param int $friend_user_id369 * @param object $friendship Optional372 * @param int $friendship_id 373 * @param int $initiator_user_id 374 * @param int $friend_user_id 375 * @param object|bool $friendship Optional 370 376 */ 371 377 function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) { -
trunk/src/bp-friends/bp-friends-cache.php
r9819 r9995 18 18 * 19 19 * @param int $friendship_id ID of the friendship whose two members should 20 * have their friends cache busted. 20 * have their friends cache busted. 21 * 22 * @return bool 21 23 */ 22 24 function friends_clear_friend_object_cache( $friendship_id ) { … … 37 39 * @since BuddyPress (2.0.0) 38 40 * 39 * @param int $friend_user_id The user ID not initiating the friendship 41 * @param int $friend_user_id The user ID not initiating the friendship. 40 42 */ 41 43 function bp_friends_clear_request_cache( $friend_user_id ) { … … 50 52 * @since BuddyPress (2.0.0) 51 53 * 52 * @param int $friendship_id The friendship ID53 * @param int $initiator_user_id The user ID initiating the friendship 54 * @param int $friend_user_id The user ID not initiating the friendship54 * @param int $friendship_id The friendship ID. 55 * @param int $initiator_user_id The user ID initiating the friendship. 56 * @param int $friend_user_id The user ID not initiating the friendship. 55 57 */ 56 58 function bp_friends_clear_request_cache_on_save( $friendship_id, $initiator_user_id, $friend_user_id ) { … … 67 69 * @since BuddyPress (2.0.0) 68 70 * 69 * @param int $friendship_id The friendship ID71 * @param int $friendship_id The friendship ID. 70 72 * @param BP_Friends_Friendship $friendship 71 73 */ 72 74 function bp_friends_clear_request_cache_on_remove( $friendship_id, BP_Friends_Friendship $friendship ) { 73 bp_friends_clear_request_cache( $friendship->friend_user_id ); 75 bp_friends_clear_request_cache( $friendship->friend_user_id ); 74 76 } 75 77 add_action( 'friends_friendship_withdrawn', 'bp_friends_clear_request_cache_on_remove', 10, 2 ); -
trunk/src/bp-friends/bp-friends-classes.php
r9819 r9995 1 1 <?php 2 2 /** 3 * BuddyPress Friends Classes 3 * BuddyPress Friends Classes. 4 4 * 5 5 * @package BuddyPress -
trunk/src/bp-friends/bp-friends-filters.php
r9819 r9995 2 2 3 3 /** 4 * BuddyPress Friend Filters 4 * BuddyPress Friend Filters. 5 5 * 6 6 * @package BuddyPress … … 18 18 * @global WPDB $wpdb WordPress database access object. 19 19 * 20 * @param BP_User_Query $user_query The BP_User_Query object.21 * @param string $user_ids_sql Comma-separated list of user IDs to fetch extra22 * data for, as determined by BP_User_Query.20 * @param BP_User_Query $user_query The BP_User_Query object. 21 * @param string $user_ids_sql Comma-separated list of user IDs to fetch extra 22 * data for, as determined by BP_User_Query. 23 23 */ 24 24 function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) { -
trunk/src/bp-friends/bp-friends-functions.php
r9819 r9995 2 2 3 3 /** 4 * BuddyPress Friends Functions 4 * BuddyPress Friends Functions. 5 5 * 6 6 * Functions are where all the magic happens in BuddyPress. They will … … 19 19 * Create a new friendship. 20 20 * 21 * @param int $initiator_userid ID of the "initiator" user (the user who is 22 * sending the friendship request). 23 * @param int $friend_userid ID of the "friend" user (the user whose friendship 24 * is being requested). 25 * @param bool $force_accept Optional. Whether to force acceptance. When false, 26 * running friends_add_friend() will result in a friendship request. 27 * When true, running friends_add_friend() will result in an accepted 28 * friendship, with no notifications being sent. Default: false. 21 * @param int $initiator_userid ID of the "initiator" user (the user who is 22 * sending the friendship request). 23 * @param int $friend_userid ID of the "friend" user (the user whose friendship 24 * is being requested). 25 * @param bool $force_accept Optional. Whether to force acceptance. When false, 26 * running friends_add_friend() will result in a friendship request. 27 * When true, running friends_add_friend() will result in an accepted 28 * friendship, with no notifications being sent. Default: false. 29 * 29 30 * @return bool True on success, false on failure. 30 31 */ … … 76 77 * @since BuddyPress (1.0.0) 77 78 * 78 * @param int $id ID of the pending friendship connection.79 * @param int $id ID of the pending friendship connection. 79 80 * @param int $initiator_user_id ID of the friendship initiator. 80 * @param int $friend_user_id ID of the friend user.81 * @param object $friendship BuddyPress Friendship Object.81 * @param int $friend_user_id ID of the friend user. 82 * @param object $friendship BuddyPress Friendship Object. 82 83 */ 83 84 do_action( 'friends_friendship_' . $action, $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship ); … … 92 93 * 93 94 * @param int $initiator_userid ID of the friendship initiator. 94 * @param int $friend_userid ID of the friend user. 95 * @param int $friend_userid ID of the friend user. 96 * 95 97 * @return bool True on success, false on failure. 96 98 */ … … 106 108 * @since BuddyPress (1.5.0) 107 109 * 108 * @param int $friendship_id ID of the friendship object, if any, between a pair of users.110 * @param int $friendship_id ID of the friendship object, if any, between a pair of users. 109 111 * @param int $initiator_userid ID of the friendship initiator. 110 * @param int $friend_userid ID of the friend user.112 * @param int $friend_userid ID of the friend user. 111 113 */ 112 114 do_action( 'friends_before_friendship_delete', $friendship_id, $initiator_userid, $friend_userid ); … … 123 125 * @since BuddyPress (1.0.0) 124 126 * 125 * @param int $friendship_id ID of the friendship object, if any, between a pair of users.127 * @param int $friendship_id ID of the friendship object, if any, between a pair of users. 126 128 * @param int $initiator_userid ID of the friendship initiator. 127 * @param int $friend_userid ID of the friend user.129 * @param int $friend_userid ID of the friend user. 128 130 */ 129 131 do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid ); … … 138 140 * 139 141 * @param int $initiator_userid ID of the friendship initiator. 140 * @param int $friend_userid ID of the friend user.142 * @param int $friend_userid ID of the friend user. 141 143 */ 142 144 do_action( 'friends_friendship_post_delete', $initiator_userid, $friend_userid ); … … 154 156 * 155 157 * @param int $friendship_id ID of the pending friendship object. 158 * 156 159 * @return bool True on success, false on failure. 157 160 */ … … 172 175 * @since BuddyPress (1.0.0) 173 176 * 174 * @param int $id ID of the pending friendship object.177 * @param int $id ID of the pending friendship object. 175 178 * @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.179 * @param int $friend_user_id ID of the user requested friendship with. 180 * @param object $friendship BuddyPress Friendship Object. 178 181 */ 179 182 do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship ); … … 189 192 * 190 193 * @param int $friendship_id ID of the pending friendship object. 194 * 191 195 * @return bool True on success, false on failure. 192 196 */ … … 215 219 * 216 220 * @param int $initiator_userid ID of the friendship initiator - this is the 217 * user who requested the friendship, and is doing the withdrawing. 218 * @param int $friend_userid ID of the requested friend. 221 * user who requested the friendship, and is doing the withdrawing. 222 * @param int $friend_userid ID of the requested friend. 223 * 219 224 * @return bool True on success, false on failure. 220 225 */ … … 234 239 * 235 240 * @param int $friendship_id ID of the friendship. 236 * @param BP_Friends_Friendship $friendship Friendship object. Passed by reference.241 * @param BP_Friends_Friendship $friendship Friendship object. Passed by reference. 237 242 */ 238 243 do_action_ref_array( 'friends_friendship_withdrawn', array( $friendship_id, &$friendship ) ); … … 247 252 * Check whether two users are friends. 248 253 * 249 * @param int $user_id ID of the first user.254 * @param int $user_id ID of the first user. 250 255 * @param int $possible_friend_id ID of the other user. 256 * 251 257 * @return bool Returns true if the two users are friends, otherwise false. 252 258 */ … … 264 270 * Will return 'is_friends', 'not_friends', 'pending' or 'awaiting_response'. 265 271 * 266 * @param int $user_id ID of the first user.272 * @param int $user_id ID of the first user. 267 273 * @param int $possible_friend_id ID of the other user. 274 * 268 275 * @return string Friend status of the two users. 269 276 */ … … 291 298 * 292 299 * @param int $user_id ID of the user whose friends are being counted. 300 * 293 301 * @return int Friend count of the user. 294 302 */ … … 315 323 * 316 324 * @param int $user_id ID of the user whose friends are being checked. 325 * 317 326 * @return bool True if the user has friends, otherwise false. 318 327 */ … … 333 342 * 334 343 * @param int $initiator_user_id ID of the first user. 335 * @param int $friend_user_id ID of the second user. 344 * @param int $friend_user_id ID of the second user. 345 * 336 346 * @return int|bool ID of the friendship if found, otherwise false. 337 347 */ … … 343 353 * Get the IDs of a given user's friends. 344 354 * 345 * @param int $user_idID of the user whose friends are being retrieved.355 * @param int $user_id ID of the user whose friends are being retrieved. 346 356 * @param bool $friend_requests_only Optional. Whether to fetch unaccepted 347 * requests only. Default: false. 348 * @param bool $assoc_arr Optional. True to receive an array of arrays keyed as 349 * 'user_id' => $user_id; false to get a one-dimensional array of user 350 * IDs. Default: false. 357 * requests only. Default: false. 358 * @param bool $assoc_arr Optional. True to receive an array of arrays keyed as 359 * 'user_id' => $user_id; false to get a one-dimensional 360 * array of user IDs. Default: false. 361 * 362 * @return array 351 363 */ 352 364 function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) { … … 357 369 * Search the friends of a user by a search string. 358 370 * 359 * @param string $filter The search string, matched against xprofile fields (if 360 * available), or usermeta 'nickname' field. 361 * @param int $user_id ID of the user whose friends are being searched. 362 * @param int $limit Optional. Max number of friends to return. 363 * @param int $page Optional. The page of results to return. Default: null (no 364 * pagination - return all results). 371 * @param string $search_terms The search string, matched against xprofile fields (if 372 * available), or usermeta 'nickname' field. 373 * @param int $user_id ID of the user whose friends are being searched. 374 * @param int $pag_num Optional. Max number of friends to return. 375 * @param int $pag_page Optional. The page of results to return. Default: null (no 376 * pagination - return all results). 377 * 365 378 * @return array|bool On success, an array: { 366 379 * @type array $friends IDs of friends returned by the query. 367 * @type int $countTotal number of friends (disregarding368 * pagination) who match the search.380 * @type int $count Total number of friends (disregarding 381 * pagination) who match the search. 369 382 * }. Returns false on failure. 370 383 */ … … 376 389 * Get a list of IDs of users who have requested friendship of a given user. 377 390 * 378 * @param int $user_id The ID of the user who has received the friendship 379 * requests.391 * @param int $user_id The ID of the user who has received the friendship requests. 392 * 380 393 * @return array|bool An array of user IDs, or false if none are found. 381 394 */ … … 389 402 * @see BP_Core_User::get_users() for a description of return value. 390 403 * 391 * @param int $user_id ID of the user whose friends are being retrieved. 392 * @param int $per_page Optional. Number of results to return per page. 393 * Default: 0 (no pagination; show all results). 394 * @param int $page Optional. Number of the page of results to return. 395 * Default: 0 (no pagination; show all results). 396 * @param string $filter Optional. Limit results to those matching a search 397 * string. 404 * @param int $user_id ID of the user whose friends are being retrieved. 405 * @param int $per_page Optional. Number of results to return per page. 406 * Default: 0 (no pagination; show all results). 407 * @param int $page Optional. Number of the page of results to return. 408 * Default: 0 (no pagination; show all results). 409 * @param string $filter Optional. Limit results to those matching a search 410 * string. 411 * 398 412 * @return array See {@link BP_Core_User::get_users()}. 399 413 */ … … 418 432 * @see BP_Core_User::get_users() for a description of return value. 419 433 * 420 * @param int $user_id ID of the user whose friends are being retrieved. 421 * @param int $per_page Optional. Number of results to return per page. 422 * Default: 0 (no pagination; show all results). 423 * @param int $page Optional. Number of the page of results to return. 424 * Default: 0 (no pagination; show all results). 425 * @param string $filter Optional. Limit results to those matching a search 426 * string. 434 * @param int $user_id ID of the user whose friends are being retrieved. 435 * @param int $per_page Optional. Number of results to return per page. 436 * Default: 0 (no pagination; show all results). 437 * @param int $page Optional. Number of the page of results to return. 438 * Default: 0 (no pagination; show all results). 439 * @param string $filter Optional. Limit results to those matching a search 440 * string. 441 * 427 442 * @return array See {@link BP_Core_User::get_users()}. 428 443 */ … … 447 462 * @see BP_Core_User::get_users() for a description of return value. 448 463 * 449 * @param int $user_id ID of the user whose friends are being retrieved. 450 * @param int $per_page Optional. Number of results to return per page. 451 * Default: 0 (no pagination; show all results). 452 * @param int $page Optional. Number of the page of results to return. 453 * Default: 0 (no pagination; show all results). 454 * @param string $filter Optional. Limit results to those matching a search 455 * string. 464 * @param int $user_id ID of the user whose friends are being retrieved. 465 * @param int $per_page Optional. Number of results to return per page. 466 * Default: 0 (no pagination; show all results). 467 * @param int $page Optional. Number of the page of results to return. 468 * Default: 0 (no pagination; show all results). 469 * @param string $filter Optional. Limit results to those matching a search 470 * string. 471 * 456 472 * @return array See {@link BP_Core_User::get_users()}. 457 473 */ … … 477 493 * arguments and return value. 478 494 * 479 * @param array $user_ids See BP_Friends_Friendship::get_bulk_last_active(). 495 * @param array $friend_ids See BP_Friends_Friendship::get_bulk_last_active(). 496 * 480 497 * @return array $user_ids See BP_Friends_Friendship::get_bulk_last_active(). 481 498 */ … … 492 509 * @since BuddyPress (1.0.0) 493 510 * 494 * @param int $user_id User ID whose friends to see can be invited. Default:495 * ID of the logged-in user.511 * @param int $user_id User ID whose friends to see can be invited. Default: 512 * ID of the logged-in user. 496 513 * @param int $group_id Group to check possible invitations against. 514 * 497 515 * @return mixed False if no friends, array of users if friends. 498 516 */ … … 567 585 * @since BuddyPress (1.5.4) 568 586 * 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.587 * @param array|bool $friends Array friends available to invite or false for no friends. 588 * @param int $user_id ID of the user checked for who they can invite. 571 589 * @param int $group_id ID of the group being checked on. 572 590 */ … … 583 601 * - users who have been banned from the group 584 602 * 585 * @param int $user_id ID of the user whose friends are being counted.603 * @param int $user_id ID of the user whose friends are being counted. 586 604 * @param int $group_id ID of the group friends are being invited to. 605 * 587 606 * @return int $invitable_count Eligible friend count. 588 607 */ … … 595 614 * 596 615 * @param int $user_id Optional. ID of the user whose friendships you are 597 * counting. Default: displayed user (if any), otherwise logged-in user. 616 * counting. Default: displayed user (if any), otherwise logged-in user. 617 * 598 618 * @return int Friend count for the user. 599 619 */ … … 606 626 * 607 627 * @param string $search_terms Search term to filter on. 608 * @param int $user_id ID of the user whose friends are being searched. 609 * @param int $pag_num Number of results to return per page. Default: 0 (no 610 * pagination - show all results). 611 * @param int $pag_num Number of the page being requested. Default: 0 (no 612 * pagination - show all results). 628 * @param int $user_id ID of the user whose friends are being searched. 629 * @param int $pag_num Number of results to return per page. Default: 0 (no 630 * pagination - show all results). 631 * @param int $pag_page Number of the page being requested. Default: 0 (no 632 * pagination - show all results). 633 * 613 634 * @return array Array of BP_Core_User objects corresponding to friends. 614 635 */ … … 631 652 * 632 653 * @param int $friendship_id The ID of the friendship being checked. 654 * 633 655 * @return bool True if the friendship is confirmed, otherwise false. 634 656 */ … … 645 667 * the cached values. 646 668 * 647 * @param int $initiator_user_id ID of the first user.648 * @param int $friend_user_idID of the second user.649 * @param string $status Optional. The friendship event that's been triggered.650 * 'add' will ++ each user's friend counts, while any other string651 * will --.669 * @param int $initiator_user_id ID of the first user. 670 * @param int $friend_user_id ID of the second user. 671 * @param string $status Optional. The friendship event that's been triggered. 672 * 'add' will ++ each user's friend counts, while any other string 673 * will --. 652 674 */ 653 675 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { … … 667 689 * Removes the following: 668 690 * 669 * - Friendships of which the user is a member 670 * - Cached friend count for the user 671 * - Notifications of friendship requests sent by the user 691 * - Friendships of which the user is a member. 692 * - Cached friend count for the user. 693 * - Notifications of friendship requests sent by the user. 672 694 * 673 695 * @param int $user_id ID of the user whose friend data is being removed. -
trunk/src/bp-friends/bp-friends-loader.php
r9936 r9995 1 1 <?php 2 2 /** 3 * BuddyPress Friends Streams Loader 3 * BuddyPress Friends Streams Loader. 4 4 * 5 5 * The friends component is for users to create relationships with each other. … … 107 107 * 108 108 * @param array $main_nav Optional. See BP_Component::setup_nav() for 109 * description.110 * @param array $sub_nav Optional. See BP_Component::setup_nav() for111 * description.109 * description. 110 * @param array $sub_nav Optional. See BP_Component::setup_nav() for 111 * description. 112 112 */ 113 113 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { … … 170 170 * 171 171 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 172 * for description.172 * for description. 173 173 */ 174 174 public function setup_admin_bar( $wp_admin_nav = array() ) { … … 243 243 244 244 /** 245 * Setup cache groups 245 * Setup cache groups. 246 246 * 247 247 * @since BuddyPress (2.2.0) -
trunk/src/bp-friends/bp-friends-notifications.php
r9819 r9995 2 2 3 3 /** 4 * BuddyPress Friends Activity Functions 4 * BuddyPress Friends Activity Functions. 5 5 * 6 6 * These functions handle the recording, deleting and formatting of activity … … 23 23 * 24 24 * @param int $friendship_id ID of the friendship object. 25 * @param int $initiator_id ID of the user who initiated the request. 26 * @param int $friend_id ID of the request recipient. 25 * @param int $initiator_id ID of the user who initiated the request. 26 * @param int $friend_id ID of the request recipient. 27 * 28 * @return bool 27 29 */ 28 30 function friends_notification_new_request( $friendship_id, $initiator_id, $friend_id ) { … … 71 73 * @since BuddyPress (1.2.0) 72 74 * 73 * @param string $subject Subject line to be used in friend request email.75 * @param string $subject Subject line to be used in friend request email. 74 76 * @param string $initiator_name Name of the person requesting friendship. 75 77 */ … … 81 83 * @since BuddyPress (1.2.0) 82 84 * 83 * @param string $message Message to be used in friend request email.84 * @param string $initiator_name Name of the person requesting friendship.85 * @param string $initiator_link Profile link of person requesting friendship.85 * @param string $message Message to be used in friend request email. 86 * @param string $initiator_name Name of the person requesting friendship. 87 * @param string $initiator_link Profile link of person requesting friendship. 86 88 * @param string $all_requests_link User's friends request management link. 87 * @param string $settings_link Email recipient's settings management link.89 * @param string $settings_link Email recipient's settings management link. 88 90 */ 89 91 $message = apply_filters( 'friends_notification_new_request_message', $message, $initiator_name, $initiator_link, $all_requests_link, $settings_link ); … … 96 98 * @since BuddyPress (1.5.0) 97 99 * 98 * @param int $friend_id ID of the request recipient.99 * @param string $subject Text for the friend request subject field.100 * @param string $message Text for the friend request message field.100 * @param int $friend_id ID of the request recipient. 101 * @param string $subject Text for the friend request subject field. 102 * @param string $message Text for the friend request message field. 101 103 * @param int $friendship_id ID of the friendship object. 102 * @param int $initiator_id ID of the friendship requester.104 * @param int $initiator_id ID of the friendship requester. 103 105 */ 104 106 do_action( 'bp_friends_sent_request_email', $friend_id, $subject, $message, $friendship_id, $initiator_id ); … … 113 115 * 114 116 * @param int $friendship_id ID of the friendship object. 115 * @param int $initiator_id ID of the user who initiated the request. 116 * @param int $friend_id ID of the request recipient. 117 * @param int $initiator_id ID of the user who initiated the request. 118 * @param int $friend_id ID of the request recipient. 119 * 120 * @return bool 117 121 */ 118 122 function friends_notification_accepted_request( $friendship_id, $initiator_id, $friend_id ) { … … 158 162 * @since BuddyPress (1.2.0) 159 163 * 160 * @param string $subject Subject line to be used in friend request accepted email.164 * @param string $subject Subject line to be used in friend request accepted email. 161 165 * @param string $friend_name Name of the person who accepted the friendship request. 162 166 */ … … 168 172 * @since BuddyPress (1.2.0) 169 173 * 170 * @param string $message Message to be used in friend request email.171 * @param string $friend_name Name of the person who accepted the friendship request.172 * @param string $friend_link Profile link of person who accepted the friendship request.174 * @param string $message Message to be used in friend request email. 175 * @param string $friend_name Name of the person who accepted the friendship request. 176 * @param string $friend_link Profile link of person who accepted the friendship request. 173 177 * @param string $settings_link Email recipient's settings management link. 174 178 */ … … 182 186 * @since BuddyPress (1.5.0) 183 187 * 184 * @param int $initiator_id ID of the friendship requester.185 * @param string $subject Text for the friend request subject field.186 * @param string $message Text for the friend request message field.188 * @param int $initiator_id ID of the friendship requester. 189 * @param string $subject Text for the friend request subject field. 190 * @param string $message Text for the friend request message field. 187 191 * @param int $friendship_id ID of the friendship object. 188 * @param int $friend_id ID of the request recipient.192 * @param int $friend_id ID of the request recipient. 189 193 */ 190 194 do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id ); … … 197 201 * Notification formatting callback for bp-friends notifications. 198 202 * 199 * @param string $action The kind of notification being rendered. 200 * @param int $item_id The primary item ID. 201 * @param int $secondary_item_id The secondary item ID. 202 * @param int $total_items The total number of messaging-related notifications 203 * waiting for the user. 204 * @param string $format 'string' for BuddyBar-compatible notifications; 205 * 'array' for WP Toolbar. Default: 'string'. 203 * @param string $action The kind of notification being rendered. 204 * @param int $item_id The primary item ID. 205 * @param int $secondary_item_id The secondary item ID. 206 * @param int $total_items The total number of messaging-related notifications 207 * waiting for the user. 208 * @param string $format 'string' for BuddyBar-compatible notifications; 209 * 'array' for WP Toolbar. Default: 'string'. 210 * 206 211 * @return array|string 207 212 */ … … 328 333 * 329 334 * @since BuddyPress (1.9.0) 330 * @param int $friendship_id The unique ID of the friendship331 * @param int $initiator_user_id The friendship initiator user ID 332 * @param int $friend_user_id The friendship request receiver user ID335 * @param int $friendship_id The unique ID of the friendship. 336 * @param int $initiator_user_id The friendship initiator user ID. 337 * @param int $friend_user_id The friendship request receiver user ID. 333 338 */ 334 339 function bp_friends_friendship_requested_notification( $friendship_id, $initiator_user_id, $friend_user_id ) { … … 352 357 * @since BuddyPress (1.9.0) 353 358 * 354 * @param int $friendship_id (not used)359 * @param int $friendship_id (not used) 355 360 * @param object $friendship 356 361 */ … … 366 371 * 367 372 * @since BuddyPress (1.9.0) 368 * @param int $friendship_id The unique ID of the friendship 369 * @param int $initiator_user_id The friendship initiator user ID 370 * @param int $friend_user_id The friendship request receiver user ID 373 * 374 * @param int $friendship_id The unique ID of the friendship. 375 * @param int $initiator_user_id The friendship initiator user ID. 376 * @param int $friend_user_id The friendship request receiver user ID. 371 377 */ 372 378 function bp_friends_add_friendship_accepted_notification( $friendship_id, $initiator_user_id, $friend_user_id ) { … … 394 400 395 401 /** 396 * Remove friend request notice when a member withdraws their friend request 397 * 398 * @since BuddyPress (1.9.0) 399 * 400 * @param int $friendship_id (not used)402 * Remove friend request notice when a member withdraws their friend request. 403 * 404 * @since BuddyPress (1.9.0) 405 * 406 * @param int $friendship_id (not used) 401 407 * @param object $friendship 402 408 */ … … 409 415 410 416 /** 411 * Remove friendship requests FROM user, used primarily when a user is deleted 412 * 413 * @since BuddyPress (1.9.0) 417 * Remove friendship requests FROM user, used primarily when a user is deleted. 418 * 419 * @since BuddyPress (1.9.0) 420 * 414 421 * @param int $user_id 415 422 */ -
trunk/src/bp-friends/bp-friends-screens.php
r9819 r9995 2 2 3 3 /** 4 * BuddyPress Friends Screen Functions 4 * BuddyPress Friends Screen Functions. 5 5 * 6 6 * Screen functions are the controllers of BuddyPress. They will execute when -
trunk/src/bp-friends/bp-friends-template.php
r9819 r9995 263 263 * 264 264 * @param int $user_id Optional. If provided, the function will simply 265 * return this value. 265 * return this value. 266 * 266 267 * @return int ID of potential friend. 267 268 */ … … 290 291 * 291 292 * @param int $user_id ID of the potential friend. Default: the value of 292 * {@link bp_get_potential_friend_id()}. 293 * {@link bp_get_potential_friend_id()}. 294 * 293 295 * @return string 'is_friend', 'not_friends', or 'pending'. 294 296 */ … … 319 321 * @see bp_get_add_friend_button() for information on arguments. 320 322 * 321 * @param int $potential_friend_id See {@link bp_get_add_friend_button()}.322 * @param int $friend_statusSee {@link bp_get_add_friend_button()}.323 * @param int $potential_friend_id See {@link bp_get_add_friend_button()}. 324 * @param int|bool $friend_status See {@link bp_get_add_friend_button()}. 323 325 */ 324 326 function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false ) { … … 328 330 * Create the Add Friend button. 329 331 * 330 * @param int $potential_friend_id ID of the user to whom the button 331 * applies. Default: value of {@link bp_get_potential_friend_id()}. 332 * @param bool $friend_status Not currently used. 332 * @param int $potential_friend_id ID of the user to whom the button 333 * applies. Default: value of {@link bp_get_potential_friend_id()}. 334 * @param bool $friend_status Not currently used. 335 * 333 336 * @return string HTML for the Add Friend button. 334 337 */ … … 427 430 * 428 431 * @param int $user_id Optional. Default: the displayed user's ID, or the 429 * logged-in user's ID. 432 * logged-in user's ID. 433 * 430 434 * @return string|bool A comma-separated list of friend IDs if any are found, 431 * otherwise false.435 * otherwise false. 432 436 */ 433 437 function bp_get_friend_ids( $user_id = 0 ) { … … 451 455 * 452 456 * @param int $user_id ID of the user whose requests are being retrieved. 453 * Defaults to displayed user. 457 * Defaults to displayed user. 458 * 454 459 * @return array|int An array of user IDs if found, or a 0 if none are found. 455 460 */ … … 580 585 * 581 586 * @param int $user_id See {@link friends_get_total_friend_count()}. 587 * 582 588 * @return int Total friend count. 583 589 */ … … 609 615 * 610 616 * @param int $user_id ID of the user whose requests are being counted. 611 * Default: ID of the logged-in user. 617 * Default: ID of the logged-in user. 618 * 612 619 * @return int Friend count. 613 620 */ … … 633 640 * @since BuddyPress (2.0.0) 634 641 * 635 * @param array $args before|after|user_id 636 * @uses bp_friends_get_profile_stats() to get the stats 642 * @uses bp_friends_get_profile_stats() to get the stats. 643 * 644 * @param array|string $args before|after|user_id 637 645 */ 638 646 function bp_friends_profile_stats( $args = '' ) { … … 646 654 * @since BuddyPress (2.0.0) 647 655 * 648 * @param array $args before|after|user_id 656 * @param array|string $args before|after|user_id 657 * 649 658 * @return string HTML for stats output. 650 659 */ … … 682 691 * 683 692 * @param string $value Formatted string displaying total friends count. 684 * @param array $r Array of arguments for string formatting and output.693 * @param array $r Array of arguments for string formatting and output. 685 694 */ 686 695 return apply_filters( 'bp_friends_get_profile_stats', $r['output'], $r ); -
trunk/src/bp-friends/bp-friends-widgets.php
r9819 r9995 1 1 <?php 2 2 /** 3 * BuddyPress Widgets 3 * BuddyPress Widgets. 4 4 * 5 5 * @package BuddyPress … … 157 157 * @param array $new_instance The parameters saved by the user. 158 158 * @param array $old_instance The parameters as previously saved to the database. 159 * 159 160 * @return array $instance The processed settings to save. 160 161 */ … … 173 174 * 174 175 * @param array $instance The saved widget settings. 176 * 177 * @return string 175 178 */ 176 179 function form( $instance ) { -
trunk/src/bp-friends/classes/class-bp-friends-friendship.php
r9985 r9995 1 1 <?php 2 2 /** 3 * BuddyPress Friends Classes 3 * BuddyPress Friends Classes. 4 4 * 5 5 * @package BuddyPress … … 71 71 * 72 72 * @access public 73 * @var unknown73 * @var bool 74 74 */ 75 75 public $is_request; … … 94 94 * Constructor method. 95 95 * 96 * @param int $id Optional. The ID of an existing friendship. 97 * @param bool $is_request Deprecated. 98 * @param bool $populate_friend_details True if friend details should 99 * be queried. 96 * @param int $id Optional. The ID of an existing friendship. 97 * @param bool $is_request Deprecated. 98 * @param bool $populate_friend_details True if friend details should be queried. 100 99 */ 101 100 public function __construct( $id = null, $is_request = false, $populate_friend_details = true ) { … … 194 193 * Get the IDs of a given user's friends. 195 194 * 196 * @param int $user_idID of the user whose friends are being retrieved.195 * @param int $user_id ID of the user whose friends are being retrieved. 197 196 * @param bool $friend_requests_only Optional. Whether to fetch 198 * unaccepted requests only. Default: false. 199 * @param bool $assoc_arr Optional. True to receive an array of arrays 200 * keyed as 'user_id' => $user_id; false to get a one-dimensional 201 * array of user IDs. Default: false. 197 * unaccepted requests only. Default: false. 198 * @param bool $assoc_arr Optional. True to receive an array of arrays 199 * keyed as 'user_id' => $user_id; false to get a one-dimensional 200 * array of user IDs. Default: false. 201 * 202 * @return array $fids IDs of friends for provided user. 202 203 */ 203 204 public static function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) { … … 230 231 * Get the ID of the friendship object, if any, between a pair of users. 231 232 * 232 * @param int $user_id The ID of the first user.233 * @param int $user_id The ID of the first user. 233 234 * @param int $friend_id The ID of the second user. 234 * @return int|bool The ID of the friendship object if found, otherwise235 * 235 * 236 * @return int|bool The ID of the friendship object if found, otherwise false. 236 237 */ 237 238 public static function get_friendship_id( $user_id, $friend_id ) { … … 247 248 * 248 249 * @param int $user_id The ID of the user who has received the 249 * friendship requests. 250 * friendship requests. 251 * 250 252 * @return array|bool An array of user IDs, or false if none are found. 251 253 */ … … 270 272 * 271 273 * @param int $user_id Optional. ID of the user whose friendships you 272 * are counting. Default: displayed user (if any), otherwise 273 * logged-in user. 274 * are counting. Default: displayed user (if any), otherwise 275 * logged-in user. 276 * 274 277 * @return int Friend count for the user. 275 278 */ … … 299 302 * Search the friends of a user by a search string. 300 303 * 301 * @param string $filter The search string, matched against xprofile 302 * fields (if available), or usermeta 'nickname' field. 303 * @param int $user_id ID of the user whose friends are being searched. 304 * @param int $limit Optional. Max number of friends to return. 305 * @param int $page Optional. The page of results to return. Default: 306 * null (no pagination - return all results). 304 * @param string $filter The search string, matched against xprofile 305 * fields (if available), or usermeta 'nickname' field. 306 * @param int $user_id ID of the user whose friends are being searched. 307 * @param int $limit Optional. Max number of friends to return. 308 * @param int $page Optional. The page of results to return. Default: 309 * null (no pagination - return all results). 310 * 307 311 * @return array|bool On success, an array: { 308 312 * @type array $friends IDs of friends returned by the query. 309 * @type int $countTotal number of friends (disregarding310 * pagination) who match the search.313 * @type int $count Total number of friends (disregarding 314 * pagination) who match the search. 311 315 * }. Returns false on failure. 312 316 */ … … 364 368 * sent the initial request) 365 369 * 366 * @param int $initiator_userid The ID of the user who is the initiator367 * of the potential friendship/request.370 * @param int $initiator_userid The ID of the user who is the initiator 371 * of the potential friendship/request. 368 372 * @param int $possible_friend_userid The ID of the user who is the 369 * recipient of the potential friendship/request. 370 * @return string The friendship status, from among 'not_friends', 371 * 'is_friend', 'pending', and 'awaiting_response'. 373 * recipient of the potential friendship/request. 374 * 375 * @return string $value The friendship status, from among 'not_friends', 376 * 'is_friend', 'pending', and 'awaiting_response'. 372 377 */ 373 378 public static function check_is_friend( $initiator_userid, $possible_friend_userid ) { … … 401 406 * 402 407 * @param array $user_ids IDs of users whose last_active meta is 403 * being queried. 404 * @return array Array of last_active values + user_ids. 408 * being queried. 409 * 410 * @return array $retval Array of last_active values + user_ids. 405 411 */ 406 412 public static function get_bulk_last_active( $user_ids ) { … … 434 440 * 435 441 * @param int $friendship_id ID of the friendship to be accepted. 442 * 436 443 * @return int Number of database rows updated. 437 444 */ … … 448 455 * 449 456 * @param int $friendship_id ID of the friendship to be withdrawn. 457 * 450 458 * @return int Number of database rows deleted. 451 459 */ … … 462 470 * 463 471 * @param int $friendship_id ID of the friendship to be rejected. 472 * 464 473 * @return int Number of database rows deleted. 465 474 */ … … 477 486 * @todo Why does this exist, and why is it in bp-friends? 478 487 * 479 * @param string $filter String to search by. 480 * @param int $user_id A user ID param that is unused. 481 * @param int $limit Optional. Max number of records to return. 482 * @param int $page Optional. Number of the page to return. Default: 483 * false (no pagination - return all results). 488 * @param string $filter String to search by. 489 * @param int $user_id A user ID param that is unused. 490 * @param int $limit Optional. Max number of records to return. 491 * @param int $page Optional. Number of the page to return. Default: 492 * false (no pagination - return all results). 493 * 484 494 * @return array $filtered_ids IDs of users who match the query. 485 495 */ … … 521 531 * 522 532 * @param string $filter Search term. 533 * 523 534 * @return int Count of users matching the search term. 524 535 */ … … 556 567 * 557 568 * @param array $user_ids Array of user IDs. 569 * 558 570 * @return array User IDs, sorted by the associated display names. 559 571 */ … … 574 586 * Get a list of random friend IDs. 575 587 * 576 * @param int $user_id ID of the user whose friends are being retrieved.588 * @param int $user_id ID of the user whose friends are being retrieved. 577 589 * @param int $total_friends Optional. Number of random friends to get. 578 * Default: 5. 590 * Default: 5. 591 * 579 592 * @return array|bool An array of random friend user IDs on success; 580 * false if none are found.593 * false if none are found. 581 594 */ 582 595 public static function get_random_friends( $user_id, $total_friends = 5 ) { … … 608 621 * - users who have been banned from the group 609 622 * 610 * @param int $user_id ID of the user whose friends are being counted.623 * @param int $user_id ID of the user whose friends are being counted. 611 624 * @param int $group_id ID of the group friends are being invited to. 625 * 612 626 * @return int $invitable_count Eligible friend count. 613 627 */ … … 643 657 * 644 658 * @param int $friendship_id ID of the friendship. 659 * 645 660 * @return object friend_user_id and initiator_user_id. 646 661 */
Note: See TracChangeset
for help on using the changeset viewer.