Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 4 years ago

#8185 closed enhancement (fixed)

Inadequate details availabe on bp_attachments_pre_get_attachment

Reported by: sbrajesh's profile sbrajesh Owned by: imath's profile imath
Milestone: 8.0.0 Priority: normal
Severity: normal Version: 5.0.0
Component: Core Keywords: has-patch
Cc: sbrajesh

Description

The filter

bp_attachments_pre_get_attachment

Does not provide anyway to know which piece of data(is it url or path) is being fetched.

That renders the hook useless for most use case.

We should pass the $data too with the hook. Here is a patch attached with the same.

Please let me know if there is a better way to do it.

Attachments (1)

8185.diff (665 bytes) - added by sbrajesh 5 years ago.
Add $data as the 3rd parameter.

Download all attachments as: .zip

Change History (3)

@sbrajesh
5 years ago

Add $data as the 3rd parameter.

#1 @imath
4 years ago

  • Milestone changed from Awaiting Review to 8.0.0

Thanks for your report, let’s make it happen in 8.0.0

#2 @imath
4 years ago

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

In 12901:

Add a parameter to the bp_attachments_pre_get_attachment filter

Without the $data parameter it was difficult to know what was the requested data to get between the url or path. So it was pretty useless.

It's now possible to get this information as the third parameter of the filter.

Props sbrajesh

Fixes #8185

Note: See TracTickets for help on using tickets.