Skip to:
Content

BuddyPress.org

Changeset 12972


Ignore:
Timestamp:
06/12/2021 11:26:49 AM (3 years ago)
Author:
imath
Message:

BP Nouveau: apply the activity content filter the right way

Inside the BP Nouveau Template pack, the bp_nouveau_ajax_get_single_activity_content() function was applying the 'bp_get_activity_content_body' filter using the wrong function and wasn't passing the second parameter of the filter:

  • Instead of using apply_filters() it should use apply_filters_ref_array().
  • The filter parameters should also include the Activity object passed by reference.

Props sbrajesh

See #8485 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php

    r12908 r12972  
    44 *
    55 * @since 3.0.0
    6  * @version 8.0.0
     6 * @version 8.1.0
    77 */
    88
     
    311311
    312312    /** This filter is documented in bp-activity/bp-activity-template.php */
    313     $content = apply_filters( 'bp_get_activity_content_body', $activity->content );
     313    $content = apply_filters_ref_array(
     314        'bp_get_activity_content_body',
     315        array(
     316            $activity->content,
     317            &$activity
     318        )
     319    );
    314320
    315321    wp_send_json_success( array( 'contents' => $content ) );
Note: See TracChangeset for help on using the changeset viewer.