Skip to:
Content

BuddyPress.org

Changeset 10782


Ignore:
Timestamp:
05/19/2016 03:27:29 AM (4 years ago)
Author:
boonebgorges
Message:

Pass object IDs to a number of Friends template filters.

Props Offereins.
See #6997.

File:
1 edited

Legend:

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

    r10587 r10782  
    497497     *
    498498     * @since 1.2.0
    499      *
    500      * @param array|int An array of user IDs if found, or a 0 if none are found.
    501      */
    502     return apply_filters( 'bp_get_friendship_requests', $requests );
     499     * @since 2.6.0 Added the `$user_id` parameter.
     500     *
     501     * @param array|int $requests An array of user IDs if found, or a 0 if none are found.
     502     * @param int       $user_id  ID of the queried user.
     503     */
     504    return apply_filters( 'bp_get_friendship_requests', $requests, $user_id );
    503505}
    504506
     
    563565         *
    564566         * @since 1.0.0
    565          *
    566          * @param string $value Accept-friendship URL.
    567          */
    568         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' ) );
     567         * @since 2.6.0 Added the `$friendship_id` parameter.
     568         *
     569         * @param string $value         Accept-friendship URL.
     570         * @param int    $friendship_id ID of the friendship.
     571         */
     572        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' ), $friendship_id );
    569573    }
    570574
     
    596600         *
    597601         * @since 1.0.0
    598          *
    599          * @param string $value Reject-friendship URL.
    600          */
    601         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' ) );
     602         * @since 2.6.0 Added the `$friendship_id` parameter.
     603         *
     604         * @param string $value         Reject-friendship URL.
     605         * @param int    $friendship_id ID of the friendship.
     606         */
     607        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' ), $friendship_id );
    602608    }
    603609
     
    626632         *
    627633         * @since 1.2.0
    628          *
    629          * @param int $value Total friend count.
    630          */
    631         return apply_filters( 'bp_get_total_friend_count', friends_get_total_friend_count( $user_id ) );
     634         * @since 2.6.0 Added the `$user_id` parameter.
     635         *
     636         * @param int $value   Total friend count.
     637         * @param int $user_id ID of the queried user.
     638         */
     639        return apply_filters( 'bp_get_total_friend_count', friends_get_total_friend_count( $user_id ), $user_id );
    632640    }
    633641    add_filter( 'bp_get_total_friend_count', 'bp_core_number_format' );
     
    662670         *
    663671         * @since 1.2.0
    664          *
    665          * @param int $value Friendship request count.
    666          */
    667         return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) );
     672         * @since 2.6.0 Added the `$user_id` parameter.
     673         *
     674         * @param int $value   Friendship request count.
     675         * @param int $user_id ID of the queried user.
     676         */
     677        return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ), $user_id );
    668678    }
    669679
Note: See TracChangeset for help on using the changeset viewer.