Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 14 years ago

#2567 closed defect (bug) (fixed)

[patch] "Add Friend” Button Filtering

Reported by: jeffsayre's profile jeffsayre Owned by: jeffsayre's profile 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.

Attachments (1)

jeffsayre_2567_button.patch (539 bytes) - added by jeffsayre 14 years ago.
In bp-friends-templatetags.php, add additional passed variables to the apply_filters function in bp_add_friend_button()

Download all attachments as: .zip

Change History (2)

@jeffsayre
14 years ago

In bp-friends-templatetags.php, add additional passed variables to the apply_filters function in bp_add_friend_button()

#1 @johnjamesjacoby
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3162]) Fixes #2567 props jeffsayre.

Note: See TracTickets for help on using tickets.