Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Is bp-friends-template.php editable?

@terraling

Participant

I’m trying to finesse this a little further and I’m hitting the bumpers, don’t know if you have any further insights @hnla or whether you’ve run out of patience with this one (understandable).

One of the things I don’t like about how the friendship buttons work is that for pending it doesn’t differentiate who originated the request (although that is recorded in the bp_friends table in the db), so that the person who originated the request will see ‘Cancel friendship request’ when viewing the other’s profile, but vice versa, too. If the recipient of the request presses the button they get a ‘Friendship request cannot be cancelled’-type message, whereas it seems more appropriate that they shouldn’t see the button at all, or that it should be disabled.

Hooking in to ‘bp_get_add_friend_button’ I have been able to alter $button as above, but I would like to be able to get in earlier (or reproduce the relevant part of bp-friends-template.php) to be able to add some logic for the case=’pending’ to check whether the current user was the initiator of the friendship request or not, and if they were the recipient of the request, disable the button.

Any advice..? Thanks…

Skip to toolbar