Opened 14 years ago
Closed 14 years ago
#2567 closed defect (bug) (fixed)
[patch] "Add Friend” Button Filtering
Reported by: | jeffsayre | Owned by: | jeffsayre |
---|---|---|---|
Milestone: | 1.2.6 | Priority: | major |
Severity: | Version: | ||
Component: | Core | Keywords: | has-patch, privacy, filters |
Cc: |
Description
To allow for the proper privacy filtering of the “Add Friend” button, two additional variables are required to be passed. This will allow the member’s ID and current friend status to be obtained without the need for inefficient and complex string parsing of the passed $button variable.
This is necessary because since BuddyPress 1.2, the new templating system made it impossible to depend solely on using $bp->displayed_user->id to obtain the ID of the member whose "Add Friend" button might need to be filtered. This is because the ability to request friendship is now possible in three different places: the individual member's profile page, the overall Members' listing, and within a individual's friends' listing.
NOTE: It is still necessary to pass the $button variable as well as this is the final piece of the puzzle that allows for the “Add Friend” button to be removed from template output if required.
In bp-friends-templatetags.php, add additional passed variables to the apply_filters function in bp_add_friend_button()