Skip to:

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3296 closed defect (bug) (fixed)

Pass $activity_obj in bp_activity_get_permalink()

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.5 Priority: normal
Severity: Version: 1.5
Component: Activity Keywords: has-patch


It would be useful to pass the $activity_obj in the "bp_activity_get_permalink" filter so plugin authors can do checks against the activity item to modify the permalink.

Attached patch is against trunk.

Attachments (1)

3296.001.patch (1.4 KB) - added by r-a-y 13 years ago.

Download all attachments as: .zip

Change History (7)

13 years ago

#1 @boonebgorges
13 years ago

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

(In [4553]) Pass activity object to bp_activity_get_permalink filter. Fixes #3296. Props r-a-y

#2 @boonebgorges
13 years ago

New rule: No one gets new hooks and filters unless they also write PHPDoc for the function in question :)

#3 @boonebgorges
13 years ago

  • Milestone changed from Awaiting Review to 1.3

#4 @DJPaul
13 years ago

Does this break backpat with existing filters?

#5 @boonebgorges
13 years ago

No. apply_filters_ref_array() differs from apply_filters only in the way that filter arguments are passed. So

apply_filters_ref_array( 'bp_activity_get_permalink', array( $activity_id, &$activity_obj ) );

is the same as

apply_filters( 'bp_activity_get_permalink', $activity_id, &$activity_obj );

Just tested with some filters on my local install and it's working as expected.

#6 @r-a-y
13 years ago

Re: PHPDoc - I'll keep that in mind for future patches ;)

Note: See TracTickets for help on using tickets.