Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/07/2015 05:52:08 AM (8 years ago)
Author:
r-a-y
Message:

Friends: Fix issue with using friends_check_friendship_status() during the members loop when the legacy user query is enabled.

Previously, if the legacy user query was enabled, the friendship button in
the members loop would always return "Add Friend" regardless of the actual
friendship status.

This commit fixes this by setting the 'not_friends' status inside the
the bp_friends_filter_user_query_populate_extras() function instead of
in friends_check_friendship_status().

Fixes #6577.

File:
1 edited

Legend:

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

    r9995 r10037  
    283283        if ( isset( $members_template->member->friendship_status ) ) {
    284284            return $members_template->member->friendship_status;
    285 
    286         // make sure that the friends BP_User_Query was registered before assuming
    287         // status as 'not_friends'
    288         } elseif ( has_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras' ) ) {
    289             return 'not_friends';
    290285        }
    291286    }
Note: See TracChangeset for help on using the changeset viewer.