Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/24/2011 02:00:04 PM (15 years ago)
Author:
djpaul
Message:

First pass of Akismet support for the Activity component. See #3660

File:
1 edited

Legend:

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

    r5109 r5259  
    702702                'exclude'          => false,  // Comma-separated list of activity IDs to exclude
    703703                'in'               => false,  // Comma-separated list or array of activity IDs to which you want to limit the query
     704                'hide_spam'        => true,   // Don't retrieve items marked as spam?
    704705
    705706                /**
     
    721722        if ( 1 == (int)$page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && 'DESC' == $sort && empty( $exclude ) ) {
    722723                if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
    723                         $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
     724                        $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden, false, false, $hide_spam );
    724725                        wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
    725726                }
    726         } else
    727                 $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden, $exclude, $in );
     727
     728        } else {
     729                $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden, $exclude, $in, $hide_spam );
     730        }
    728731
    729732        return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
     
    746749        $defaults = array(
    747750                'activity_ids'     => false,  // A single activity_id or array of IDs.
     751                'display_comments' => false,  // true or false to display threaded comments for these specific activity items
     752                'hide_spam'        => false,  // Retrieve items marked as spam
     753                'max'              => false,  // Maximum number of results to return
    748754                'page'             => 1,      // page 1 without a per_page will result in no pagination.
    749755                'per_page'         => false,  // results per page
    750                 'max'              => false,  // Maximum number of results to return
     756                'show_hidden'      => true,   // When fetching specific items, show all
    751757                'sort'             => 'DESC', // sort ASC or DESC
    752                 'display_comments' => false,  // true or false to display threaded comments for these specific activity items
    753                 'show_hidden'      => true    // When fetching specific items, show all
    754758        );
    755759        $r = wp_parse_args( $args, $defaults );
    756760        extract( $r, EXTR_SKIP );
    757761
    758         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 ) );
     762        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, $hide_spam ) );
    759763}
    760764
     
    792796                'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
    793797                'recorded_time'     => bp_core_current_time(), // The GMT time that this activity was recorded
    794                 'hide_sitewide'     => false  // Should this be hidden on the sitewide activity stream?
     798                'hide_sitewide'     => false, // Should this be hidden on the sitewide activity stream?
     799                'is_spam'           => false, // Is this activity item to be marked as spam?
    795800        );
    796801        $params = wp_parse_args( $args, $defaults );
     
    816821        $activity->date_recorded     = $recorded_time;
    817822        $activity->hide_sitewide     = $hide_sitewide;
     823        $activity->is_spam           = $is_spam;
    818824
    819825        if ( !$activity->save() )
Note: See TracChangeset for help on using the changeset viewer.