Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/21/2021 12:11:12 PM (6 months ago)
Author:
imath
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-attachments.php

    r12588 r12901  
    468468     *     @type string $file       The name of the file.
    469469     * }
    470      */
    471     $pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r );
     470     * @param string $data          The requested data `url` or `path`.
     471     */
     472    $pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r, $data );
    472473    if ( $pre_filter !== null ) {
    473474        return $pre_filter;
Note: See TracChangeset for help on using the changeset viewer.