Changeset 9176
- Timestamp:
- 11/25/2014 03:00:40 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-template.php
r8546 r9176 27 27 */ 28 28 function bp_get_friends_slug() { 29 30 /** 31 * Filters the friends component slug. 32 * 33 * @since BuddyPress (1.5.0) 34 * 35 * @param string $value Friends component slug. 36 */ 29 37 return apply_filters( 'bp_get_friends_slug', buddypress()->friends->slug ); 30 38 } … … 46 54 */ 47 55 function bp_get_friends_root_slug() { 56 57 /** 58 * Filters the friends component root slug. 59 * 60 * @since BuddyPress (1.5.0) 61 * 62 * @param string $value Friends component root slug. 63 */ 48 64 return apply_filters( 'bp_get_friends_root_slug', buddypress()->friends->root_slug ); 49 65 } … … 213 229 global $members_template; 214 230 215 if ( 1 == (int) $members_template->member->total_friend_count ) 231 if ( 1 == (int) $members_template->member->total_friend_count ) { 232 233 /** 234 * Filters text used to denote total friend count. 235 * 236 * @since BuddyPress (1.2.0) 237 * 238 * @param string $value String of the form "x friends". 239 * @param int $value Total friend count for current member in the loop. 240 */ 216 241 return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) ); 217 else 242 } else { 243 244 /** This filter is documented in bp-friends/bp-friends-template.php */ 218 245 return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) ); 246 } 219 247 } 220 248 … … 246 274 $user_id = bp_displayed_user_id(); 247 275 276 /** 277 * Filters the ID of current user in the friend request loop. 278 * 279 * @since BuddyPress (1.2.10) 280 * 281 * @param int $user_id ID of current user in the friend request loop. 282 */ 248 283 return apply_filters( 'bp_get_potential_friend_id', (int) $user_id ); 249 284 } … … 269 304 return false; 270 305 306 /** 307 * Filters the status of friendship between logged in user and given user. 308 * 309 * @since BuddyPress (1.2.10) 310 * 311 * @param string $value String status of friendship. Possible values are 'is_friend', 'not_friends', 'pending'. 312 */ 271 313 return apply_filters( 'bp_is_friend', friends_check_friendship_status( bp_loggedin_user_id(), $user_id ), $user_id ); 272 314 } … … 371 413 } 372 414 373 // Filter and return the HTML button 415 /** 416 * Filters the HTML for the add friend button. 417 * 418 * @since BuddyPress (1.1.0) 419 * 420 * @param string $button HTML markup for add friend button. 421 */ 374 422 return bp_get_button( apply_filters( 'bp_get_add_friend_button', $button ) ); 375 423 } … … 423 471 } 424 472 473 /** 474 * Filters the total pending friendship requests for a user. 475 * 476 * @since BuddyPress (1.2.0) 477 * 478 * @param array|int An array of user IDs if found, or a 0 if none are found. 479 */ 425 480 return apply_filters( 'bp_get_friendship_requests', $requests ); 426 481 } … … 445 500 } 446 501 502 /** 503 * Filters the ID of the friendship between the logged in user and the current user in the loop. 504 * 505 * @since BuddyPress (1.2.0) 506 * 507 * @param int $friendship_id ID of the friendship. 508 */ 447 509 return apply_filters( 'bp_get_friend_friendship_id', $friendship_id ); 448 510 } … … 467 529 } 468 530 531 /** 532 * Filters the URL for accepting the current friendship request in the loop. 533 * 534 * @since BuddyPress (1.0.0) 535 * 536 * @param string $value Accept-friendship URL. 537 */ 469 538 return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) ); 470 539 } … … 489 558 } 490 559 560 /** 561 * Filters the URL for rejecting the current friendship request in the loop. 562 * 563 * @since BuddyPress (1.0.0) 564 * 565 * @param string $value Reject-friendship URL. 566 */ 491 567 return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) ); 492 568 } … … 507 583 */ 508 584 function bp_get_total_friend_count( $user_id = 0 ) { 585 586 /** 587 * Filters the total friend count for a given user. 588 * 589 * @since BuddyPress (1.2.0) 590 * 591 * @param int $value Total friend count. 592 */ 509 593 return apply_filters( 'bp_get_total_friend_count', friends_get_total_friend_count( $user_id ) ); 510 594 } … … 532 616 $user_id = bp_loggedin_user_id(); 533 617 618 /** 619 * Filters the total friendship request count for a given user. 620 * 621 * @since BuddyPress (1.2.0) 622 * 623 * @param int $value Friendship request count. 624 */ 534 625 return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) ); 535 626 } … … 585 676 } 586 677 587 // Filter and return 678 /** 679 * Filters the number of friends in user's profile. 680 * 681 * @since BuddyPress (2.0.0) 682 * 683 * @param string $value Formatted string displaying total friends count. 684 * @param array $r Array of arguments for string formatting and output. 685 */ 588 686 return apply_filters( 'bp_friends_get_profile_stats', $r['output'], $r ); 589 687 }
Note: See TracChangeset
for help on using the changeset viewer.