Skip to:
Content

BuddyPress.org

Changeset 12563


Ignore:
Timestamp:
03/03/2020 08:54:03 PM (4 years ago)
Author:
r-a-y
Message:

Activity Admin: Mirror 'bp_get_activity_action' filter arguments.

The main 'bp_get_activity_action' filter uses 3 parameters. We need
to mirror all filter arguments to prevent a potential fatal error from
occurring in the activity dashboard.

Fixes #8234.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-list-table.php

    r12551 r12563  
    697697        echo '</div>';
    698698
     699        $activity = new BP_Activity_Activity( $item['id'] );
     700
    699701        // Get activity content - if not set, use the action.
    700702        if ( ! empty( $item['content'] ) ) {
    701             $activity = new BP_Activity_Activity( $item['id'] );
    702 
    703703            /** This filter is documented in bp-activity/bp-activity-template.php */
    704704            $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'], &$activity ) );
    705705        } else {
    706             /**
    707              * Filters current activity item action.
    708              *
    709              * @since 1.2.0
    710              *
    711              * @var array $item Array index holding current activity item action.
    712              */
    713             $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
     706            // Emulate bp_get_activity_action().
     707            $r = array(
     708                'no_timestamp' => false,
     709            );
     710
     711            /** This filter is documented in bp-activity/bp-activity-template.php */
     712            $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'], &$activity, $r ) );
    714713        }
    715714
Note: See TracChangeset for help on using the changeset viewer.