Skip to:
Content

BuddyPress.org

Ticket #1055: friend-request-count-functions.patch

File friend-request-count-functions.patch, 640 bytes (added by johnjamesjacoby, 15 years ago)
  • bp-friends-templatetags.php

     
    473473<?php
    474474}
    475475
     476function bp_friend_total_requests_count( $user_id = '' ) {
     477        echo bp_friend_get_total_requests_count( $user_id );
     478}
     479        function bp_friend_get_total_requests_count( $user_id = '' ) {
     480                global $bp;
     481
     482                if ( !$user_id )
     483                        $user_id = $bp->loggedin_user->id;
     484
     485                return apply_filters( 'bp_friend_get_total_requests_count', (int) BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) );
     486        }
     487
    476488?>