Changeset 5259 for trunk/bp-activity/bp-activity-functions.php
- Timestamp:
- 10/24/2011 02:00:04 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r5109 r5259 702 702 'exclude' => false, // Comma-separated list of activity IDs to exclude 703 703 '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? 704 705 705 706 /** … … 721 722 if ( 1 == (int)$page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && 'DESC' == $sort && empty( $exclude ) ) { 722 723 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 ); 724 725 wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' ); 725 726 } 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 } 728 731 729 732 return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) ); … … 746 749 $defaults = array( 747 750 '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 748 754 'page' => 1, // page 1 without a per_page will result in no pagination. 749 755 'per_page' => false, // results per page 750 ' max' => false, // Maximum number of results to return756 'show_hidden' => true, // When fetching specific items, show all 751 757 'sort' => 'DESC', // sort ASC or DESC 752 'display_comments' => false, // true or false to display threaded comments for these specific activity items753 'show_hidden' => true // When fetching specific items, show all754 758 ); 755 759 $r = wp_parse_args( $args, $defaults ); 756 760 extract( $r, EXTR_SKIP ); 757 761 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 ) ); 759 763 } 760 764 … … 792 796 'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id 793 797 '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? 795 800 ); 796 801 $params = wp_parse_args( $args, $defaults ); … … 816 821 $activity->date_recorded = $recorded_time; 817 822 $activity->hide_sitewide = $hide_sitewide; 823 $activity->is_spam = $is_spam; 818 824 819 825 if ( !$activity->save() )
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)