Skip to:
Content

BuddyPress.org

Changeset 11351


Ignore:
Timestamp:
12/29/2016 02:08:09 AM (4 years ago)
Author:
boonebgorges
Message:

bp_get_activity_content_body filter should receive same params in all contexts.

This changeset makes all instances of bp_get_activity_content_body
consistent by ensuring that they all receive the activity object
as a second parameter. This requires switching to apply_filters_ref_array(),
so that the second param can always be passed by reference.

Props sanket.parmar.
Fixes #6971.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r11311 r11351  
    34423442
    34433443    /** This filter is documented in bp-activity/bp-activity-template.php */
    3444     $content = apply_filters( 'bp_get_activity_content_body', $activity->content );
     3444    $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $activity->content, &$activity ) );
    34453445
    34463446    add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
     
    35103510
    35113511    /** This filter is documented in bp-activity/bp-activity-template.php */
    3512     $content = apply_filters( 'bp_get_activity_content_body', $params['content'] );
     3512    $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $params['content'], &$original_activity ) );
    35133513
    35143514    add_filter( 'bp_get_activity_content_body', 'convert_smilies' );
  • trunk/src/bp-activity/bp-activity-template.php

    r11280 r11351  
    13911391         * @since 1.2.0
    13921392         *
    1393          * @param array $value Array containing the current activity content body and the current activity.
     1393         * @param string $content  Content body.
     1394         * @param object $activity Activity object. Passed by reference.
    13941395         */
    13951396        return apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );
  • trunk/src/bp-activity/classes/class-bp-activity-list-table.php

    r10961 r11351  
    642642        // Get activity content - if not set, use the action.
    643643        if ( ! empty( $item['content'] ) ) {
    644 
    645             /**
    646              * Filters current activity item content.
    647              *
    648              * @since 1.2.0
    649              *
    650              * @param array $item Array index holding current activity item content.
    651              */
    652             $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
     644            $activity = new BP_Activity_Activity( $item['id'] );
     645
     646            /** This filter is documented in bp-activity/bp-activity-template.php */
     647            $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'], &$activity ) );
    653648        } else {
    654649            /**
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r11270 r11351  
    12511251
    12521252    /** This filter is documented in bp-activity/bp-activity-template.php */
    1253     $content = apply_filters( 'bp_get_activity_content_body', $activity->content );
     1253    $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $activity->content, &$activity ) );
    12541254
    12551255    exit( $content );
Note: See TracChangeset for help on using the changeset viewer.