Changeset 10323 for trunk/src/bp-friends/bp-friends-template.php
- Timestamp:
- 11/02/2015 02:07:44 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-friends/bp-friends-template.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-template.php
r10147 r10323 263 263 * @param int $user_id Optional. If provided, the function will simply 264 264 * return this value. 265 *266 265 * @return int ID of potential friend. 267 266 */ … … 291 290 * @param int $user_id ID of the potential friend. Default: the value of 292 291 * {@link bp_get_potential_friend_id()}. 293 *294 292 * @return string 'is_friend', 'not_friends', or 'pending'. 295 293 */ … … 332 330 * applies. Default: value of {@link bp_get_potential_friend_id()}. 333 331 * @param bool $friend_status Not currently used. 334 *335 332 * @return string HTML for the Add Friend button. 336 333 */ … … 357 354 'link_text' => __( 'Cancel Friendship Request', 'buddypress' ), 358 355 'link_title' => __( 'Cancel Friendship Requested', 'buddypress' ), 359 'link_id' => 'friend-' . $potential_friend_id,360 'link_rel' => 'remove',356 'link_id' => 'friend-' . $potential_friend_id, 357 'link_rel' => 'remove', 361 358 'link_class' => 'friendship-button pending_friend requested' 362 359 ); … … 430 427 * @param int $user_id Optional. Default: the displayed user's ID, or the 431 428 * logged-in user's ID. 432 *433 429 * @return string|bool A comma-separated list of friend IDs if any are found, 434 430 * otherwise false. … … 455 451 * @param int $user_id ID of the user whose requests are being retrieved. 456 452 * Defaults to displayed user. 457 *458 453 * @return array|int An array of user IDs if found, or a 0 if none are found. 459 454 */ … … 584 579 * 585 580 * @param int $user_id See {@link friends_get_total_friend_count()}. 586 *587 581 * @return int Total friend count. 588 582 */ … … 615 609 * @param int $user_id ID of the user whose requests are being counted. 616 610 * Default: ID of the logged-in user. 617 *618 611 * @return int Friend count. 619 612 */ … … 641 634 * @uses bp_friends_get_profile_stats() to get the stats. 642 635 * 643 * @param array|string $args before|after|user_id 636 * @param array|string $args before|after|user_id. 644 637 */ 645 638 function bp_friends_profile_stats( $args = '' ) { … … 653 646 * @since 2.0.0 654 647 * 655 * @param array|string $args before|after|user_id 656 * 648 * @param array|string $args before|after|user_id. 657 649 * @return string HTML for stats output. 658 650 */ 659 651 function bp_friends_get_profile_stats( $args = '' ) { 660 652 661 // Parse the args 653 // Parse the args. 662 654 $r = bp_parse_args( $args, array( 663 655 'before' => '<li class="bp-friends-profile-stats">', … … 668 660 ), 'friends_get_profile_stats' ); 669 661 670 // Allow completely overloaded output 662 // Allow completely overloaded output. 671 663 if ( empty( $r['output'] ) ) { 672 664 673 // Only proceed if a user ID was passed 665 // Only proceed if a user ID was passed. 674 666 if ( ! empty( $r['user_id'] ) ) { 675 667 676 // Get the user's friends 668 // Get the user's friends. 677 669 if ( empty( $r['friends'] ) ) { 678 670 $r['friends'] = absint( friends_get_total_friend_count( $r['user_id'] ) ); 679 671 } 680 672 681 // If friends exist, show some formatted output 673 // If friends exist, show some formatted output. 682 674 $r['output'] = $r['before'] . sprintf( _n( '%s friend', '%s friends', $r['friends'], 'buddypress' ), '<strong>' . $r['friends'] . '</strong>' ) . $r['after']; 683 675 }
Note: See TracChangeset
for help on using the changeset viewer.