Skip to:
Content

BuddyPress.org

Changeset 8475


Ignore:
Timestamp:
06/04/2014 04:46:39 PM (6 years ago)
Author:
boonebgorges
Message:

Don't use extract() in bp_blogs_record_activity()

File:
1 edited

Legend:

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

    r8474 r8475  
    288288
    289289    $r = wp_parse_args( $args, $defaults );
    290     extract( $r, EXTR_SKIP );
    291290
    292291    // Remove large images and replace them with just one image thumbnail
    293     if ( ! empty( $content ) ) {
    294         $content = bp_activity_thumbnail_content_images( $content, $primary_link, $r );
    295     }
    296 
    297     if ( ! empty( $action ) ) {
    298         $action = apply_filters( 'bp_blogs_record_activity_action', $action );
    299     }
    300 
    301     if ( ! empty( $content ) ) {
    302         $content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $content ), $content, $r );
     292    if ( ! empty( $r['content'] ) ) {
     293        $r['content'] = bp_activity_thumbnail_content_images( $r['content'], $r['primary_link'], $r );
     294    }
     295
     296    if ( ! empty( $r['action'] ) ) {
     297        $r['action'] = apply_filters( 'bp_blogs_record_activity_action', $r['action'] );
     298    }
     299
     300    if ( ! empty( $r['content'] ) ) {
     301        $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $r['content'] ), $r['content'], $r );
    303302    }
    304303
    305304    // Check for an existing entry and update if one exists.
    306305    $id = bp_activity_get_activity_id( array(
    307         'user_id'           => $user_id,
    308         'component'         => $component,
    309         'type'              => $type,
    310         'item_id'           => $item_id,
    311         'secondary_item_id' => $secondary_item_id
     306        'user_id'           => $r['user_id'],
     307        'component'         => $r['component'],
     308        'type'              => $r['type'],
     309        'item_id'           => $r['item_id'],
     310        'secondary_item_id' => $r['secondary_item_id'],
    312311    ) );
    313312
    314     return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
     313    return bp_activity_add( array( 'id' => $id, 'user_id' => $r['user_id'], 'action' => $r['action'], 'content' => $r['content'], 'primary_link' => $r['primary_link'], 'component' => $r['component'], 'type' => $r['type'], 'item_id' => $r['item_id'], 'secondary_item_id' => $r['secondary_item_id'], 'recorded_time' => $r['recorded_time'], 'hide_sitewide' => $r['hide_sitewide'] ) );
    315314}
    316315
Note: See TracChangeset for help on using the changeset viewer.