Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/01/2011 09:47:50 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Allow individual activity stream comments and forum replies to appear in favorites listings

File:
1 edited

Legend:

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

    r3982 r3985  
    153153
    154154    // Get favorites for user
    155     $favs          = get_user_meta( $user_id, 'bp_favorite_activities', true );
    156     $existing_favs = bp_activity_get_specific( array( 'activity_ids' => $favs ) );
    157 
    158     foreach( (array)$existing_favs['activities'] as $fav )
    159         $new_favs[] = $fav->id;
    160 
    161     $new_favs = array_unique( (array)$new_favs );
    162     update_user_meta( $user_id, 'bp_favorite_activities', $new_favs );
    163 
    164     return apply_filters( 'bp_activity_get_user_favorites', $new_favs );
     155    $favs = get_user_meta( $user_id, 'bp_favorite_activities', true );
     156
     157    return apply_filters( 'bp_activity_get_user_favorites', $favs );
    165158}
    166159
     
    550543        'max'              => false,  // Maximum number of results to return
    551544        'sort'             => 'DESC', // sort ASC or DESC
    552         'display_comments' => false   // true or false to display threaded comments for these specific activity items
     545        'display_comments' => false,  // true or false to display threaded comments for these specific activity items
     546        'show_hidden'      => false
    553547    );
    554548    $r = wp_parse_args( $args, $defaults );
    555549    extract( $r, EXTR_SKIP );
    556550
    557     return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids ) );
     551    return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, $show_hidden, false, $activity_ids ) );
    558552}
    559553
Note: See TracChangeset for help on using the changeset viewer.