Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2015 02:07:44 AM (11 years ago)
Author:
tw2113
Message:

More docs cleanup for Friends component.

See #6400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-template.php

    r10147 r10323  
    263263         * @param int $user_id Optional. If provided, the function will simply
    264264         *                     return this value.
    265          *
    266265         * @return int ID of potential friend.
    267266         */
    … …  
    291290 * @param int $user_id ID of the potential friend. Default: the value of
    292291 *                     {@link bp_get_potential_friend_id()}.
    293  *
    294292 * @return string 'is_friend', 'not_friends', or 'pending'.
    295293 */
    … …  
    332330         *                                  applies. Default: value of {@link bp_get_potential_friend_id()}.
    333331         * @param bool $friend_status       Not currently used.
    334          *
    335332         * @return string HTML for the Add Friend button.
    336333         */
    … …  
    357354                                        'link_text'         => __( 'Cancel Friendship Request', 'buddypress' ),
    358355                                        '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',
    361358                                        'link_class'        => 'friendship-button pending_friend requested'
    362359                                );
    … …  
    430427 * @param int $user_id Optional. Default: the displayed user's ID, or the
    431428 *                     logged-in user's ID.
    432  *
    433429 * @return string|bool A comma-separated list of friend IDs if any are found,
    434430 *                     otherwise false.
    … …  
    455451 * @param int $user_id ID of the user whose requests are being retrieved.
    456452 *                     Defaults to displayed user.
    457  *
    458453 * @return array|int An array of user IDs if found, or a 0 if none are found.
    459454 */
    … …  
    584579         *
    585580         * @param int $user_id See {@link friends_get_total_friend_count()}.
    586          *
    587581         * @return int Total friend count.
    588582         */
    … …  
    615609         * @param int $user_id ID of the user whose requests are being counted.
    616610         *                     Default: ID of the logged-in user.
    617          *
    618611         * @return int Friend count.
    619612         */
    … …  
    641634 * @uses bp_friends_get_profile_stats() to get the stats.
    642635 *
    643  * @param array|string $args before|after|user_id
     636 * @param array|string $args before|after|user_id.
    644637 */
    645638function bp_friends_profile_stats( $args = '' ) {
    … …  
    653646 * @since 2.0.0
    654647 *
    655  * @param array|string $args before|after|user_id
    656  *
     648 * @param array|string $args before|after|user_id.
    657649 * @return string HTML for stats output.
    658650 */
    659651function bp_friends_get_profile_stats( $args = '' ) {
    660652
    661         // Parse the args
     653        // Parse the args.
    662654        $r = bp_parse_args( $args, array(
    663655                'before'  => '<li class="bp-friends-profile-stats">',
    … …  
    668660        ), 'friends_get_profile_stats' );
    669661
    670         // Allow completely overloaded output
     662        // Allow completely overloaded output.
    671663        if ( empty( $r['output'] ) ) {
    672664
    673                 // Only proceed if a user ID was passed
     665                // Only proceed if a user ID was passed.
    674666                if ( ! empty( $r['user_id'] ) ) {
    675667
    676                         // Get the user's friends
     668                        // Get the user's friends.
    677669                        if ( empty( $r['friends'] ) ) {
    678670                                $r['friends'] = absint( friends_get_total_friend_count( $r['user_id'] ) );
    679671                        }
    680672
    681                         // If friends exist, show some formatted output
     673                        // If friends exist, show some formatted output.
    682674                        $r['output'] = $r['before'] . sprintf( _n( '%s friend', '%s friends', $r['friends'], 'buddypress' ), '<strong>' . $r['friends'] . '</strong>' ) . $r['after'];
    683675                }
Note: See TracChangeset for help on using the changeset viewer.