Changeset 7906
- Timestamp:
- 02/17/2014 01:07:32 AM (11 years ago)
- Location:
- trunk/bp-activity
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r7905 r7906 282 282 283 283 $defaults = array( 284 'page' => 1, // The current page 285 'per_page' => 25, // Activity items per page 286 'max' => false, // Max number of items to return 287 'sort' => 'DESC', // ASC or DESC 288 'exclude' => false, // Array of ids to exclude 289 'in' => false, // Array of ids to limit query by (IN) 290 'meta_query' => false, // Filter by activitymeta 291 'filter' => false, // See self::get_filter_sql() 292 'search_terms' => false, // Terms to search by 293 'display_comments' => false, // Whether to include activity comments 294 'show_hidden' => false, // Show items marked hide_sitewide 295 'spam' => 'ham_only', // Spam status 284 'page' => 1, // The current page 285 'per_page' => 25, // Activity items per page 286 'max' => false, // Max number of items to return 287 'sort' => 'DESC', // ASC or DESC 288 'exclude' => false, // Array of ids to exclude 289 'in' => false, // Array of ids to limit query by (IN) 290 'meta_query' => false, // Filter by activitymeta 291 'filter' => false, // See self::get_filter_sql() 292 'search_terms' => false, // Terms to search by 293 'display_comments' => false, // Whether to include activity comments 294 'show_hidden' => false, // Show items marked hide_sitewide 295 'spam' => 'ham_only', // Spam status 296 'update_meta_cache' => true, 296 297 ); 297 298 $r = wp_parse_args( $args, $defaults ); -
trunk/bp-activity/bp-activity-functions.php
r7905 r7906 899 899 function bp_activity_get( $args = '' ) { 900 900 $defaults = array( 901 'max' => false, // Maximum number of results to return902 'page' => 1, // page 1 without a per_page will result in no pagination.903 'per_page' => false, // results per page904 'sort' => 'DESC', // sort ASC or DESC905 'display_comments' => false, // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item906 907 'search_terms' => false, // Pass search terms as a string908 'meta_query' => false, // Filter by activity meta. See WP_Meta_Query for format909 'show_hidden' => false, // Show activity items that are hidden site-wide?910 'exclude' => false, // Comma-separated list of activity IDs to exclude911 'in' => false, // Comma-separated list or array of activity IDs to which you want to limit the query912 'spam' => 'ham_only', // 'ham_only' (default), 'spam_only' or 'all'.901 'max' => false, // Maximum number of results to return 902 'page' => 1, // page 1 without a per_page will result in no pagination. 903 'per_page' => false, // results per page 904 'sort' => 'DESC', // sort ASC or DESC 905 'display_comments' => false, // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item 906 907 'search_terms' => false, // Pass search terms as a string 908 'meta_query' => false, // Filter by activity meta. See WP_Meta_Query for format 909 'show_hidden' => false, // Show activity items that are hidden site-wide? 910 'exclude' => false, // Comma-separated list of activity IDs to exclude 911 'in' => false, // Comma-separated list or array of activity IDs to which you want to limit the query 912 'spam' => 'ham_only', // 'ham_only' (default), 'spam_only' or 'all'. 913 913 'update_meta_cache' => true, 914 914 … … 932 932 if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) { 933 933 $args = array( 934 'page' => $page,935 'per_page' => $per_page,936 'max' => $max,937 'sort' => $sort,938 'search_terms' => $search_terms,939 'meta_query' => $meta_query,940 'filter' => $filter,941 'display_comments' => $display_comments,942 'show_hidden' => $show_hidden,943 'spam' => $spam,934 'page' => $page, 935 'per_page' => $per_page, 936 'max' => $max, 937 'sort' => $sort, 938 'search_terms' => $search_terms, 939 'meta_query' => $meta_query, 940 'filter' => $filter, 941 'display_comments' => $display_comments, 942 'show_hidden' => $show_hidden, 943 'spam' => $spam, 944 944 'update_meta_cache' => $update_meta_cache, 945 945 ); … … 989 989 function bp_activity_get_specific( $args = '' ) { 990 990 $defaults = array( 991 'activity_ids' => false, // A single activity_id or array of IDs.992 'display_comments' => false, // true or false to display threaded comments for these specific activity items993 'max' => false, // Maximum number of results to return994 'page' => 1, // page 1 without a per_page will result in no pagination.995 'per_page' => false, // results per page996 'show_hidden' => true, // When fetching specific items, show all997 'sort' => 'DESC', // sort ASC or DESC998 'spam' => 'ham_only', // Retrieve items marked as spam991 'activity_ids' => false, // A single activity_id or array of IDs. 992 'display_comments' => false, // true or false to display threaded comments for these specific activity items 993 'max' => false, // Maximum number of results to return 994 'page' => 1, // page 1 without a per_page will result in no pagination. 995 'per_page' => false, // results per page 996 'show_hidden' => true, // When fetching specific items, show all 997 'sort' => 'DESC', // sort ASC or DESC 998 'spam' => 'ham_only', // Retrieve items marked as spam 999 999 'update_meta_cache' => true, 1000 1000 ); … … 1003 1003 1004 1004 $get_args = array( 1005 'page' => $page,1006 'per_page' => $per_page,1007 'max' => $max,1008 'sort' => $sort,1009 'display_comments' => $display_comments,1010 'show_hidden' => $show_hidden,1011 'in' => $activity_ids,1012 'spam' => $spam,1005 'page' => $page, 1006 'per_page' => $per_page, 1007 'max' => $max, 1008 'sort' => $sort, 1009 'display_comments' => $display_comments, 1010 'show_hidden' => $show_hidden, 1011 'in' => $activity_ids, 1012 'spam' => $spam, 1013 1013 'update_meta_cache' => $update_meta_cache, 1014 1014 ); -
trunk/bp-activity/bp-activity-template.php
r7905 r7906 160 160 161 161 $defaults = array( 162 'page' => 1,163 'per_page' => 20,164 'page_arg' => 'acpage',165 'max' => false,166 'sort' => false,167 'include' => false,168 'exclude' => false,169 'in' => false,170 'filter' => false,171 'search_terms' => false,172 'meta_query' => false,173 'display_comments' => 'threaded',174 'show_hidden' => false,175 'spam' => 'ham_only',162 'page' => 1, 163 'per_page' => 20, 164 'page_arg' => 'acpage', 165 'max' => false, 166 'sort' => false, 167 'include' => false, 168 'exclude' => false, 169 'in' => false, 170 'filter' => false, 171 'search_terms' => false, 172 'meta_query' => false, 173 'display_comments' => 'threaded', 174 'show_hidden' => false, 175 'spam' => 'ham_only', 176 176 'update_meta_cache' => true, 177 177 ); … … 189 189 190 190 // Fetch specific activity items based on ID's 191 if ( !empty( $include ) ) 192 $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden, 'spam' => $spam, 'update_meta_cache' => $update_meta_cache, ) ); 191 if ( !empty( $include ) ) { 192 $this->activities = bp_activity_get_specific( array( 193 'activity_ids' => explode( ',', $include ), 194 'max' => $max, 195 'page' => $this->pag_page, 196 'per_page' => $this->pag_num, 197 'sort' => $sort, 198 'display_comments' => $display_comments, 199 'show_hidden' => $show_hidden, 200 'spam' => $spam, 201 'update_meta_cache' => $update_meta_cache, 202 ) ); 193 203 194 204 // Fetch all activity items 195 else 196 $this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'meta_query' => $meta_query, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam, 'update_meta_cache' => $update_meta_cache, ) ); 205 } else { 206 $this->activities = bp_activity_get( array( 207 'display_comments' => $display_comments, 208 'max' => $max, 209 'per_page' => $this->pag_num, 210 'page' => $this->pag_page, 211 'sort' => $sort, 212 'search_terms' => $search_terms, 213 'meta_query' => $meta_query, 214 'filter' => $filter, 215 'show_hidden' => $show_hidden, 216 'exclude' => $exclude, 217 'in' => $in, 218 'spam' => $spam, 219 'update_meta_cache' => $update_meta_cache, 220 ) ); 221 } 197 222 198 223 if ( !$max || $max >= (int) $this->activities['total'] ) … … 497 522 // Note: any params used for filtering can be a single value, or multiple values comma separated. 498 523 $defaults = array( 499 'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items500 'include' => $include, // pass an activity_id or string of IDs comma-separated501 'exclude' => $exclude, // pass an activity_id or string of IDs comma-separated502 'in' => $in, // comma-separated list or array of activity IDs among which to search503 'sort' => 'DESC', // sort DESC or ASC504 'page' => 1, // which page to load505 'per_page' => 20, // number of items per page506 'max' => false, // max number to return507 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide?508 'spam' => 'ham_only', // Hide spammed items509 510 'page_arg' => 'acpage', // See https://buddypress.trac.wordpress.org/ticket/3679524 'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items 525 'include' => $include, // pass an activity_id or string of IDs comma-separated 526 'exclude' => $exclude, // pass an activity_id or string of IDs comma-separated 527 'in' => $in, // comma-separated list or array of activity IDs among which to search 528 'sort' => 'DESC', // sort DESC or ASC 529 'page' => 1, // which page to load 530 'per_page' => 20, // number of items per page 531 'max' => false, // max number to return 532 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide? 533 'spam' => 'ham_only', // Hide spammed items 534 535 'page_arg' => 'acpage', // See https://buddypress.trac.wordpress.org/ticket/3679 511 536 512 537 // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) 513 'scope' => $scope,538 'scope' => $scope, 514 539 515 540 // Filtering 516 'user_id' => $user_id, // user_id to filter on517 'object' => $object, // object to filter on e.g. groups, profile, status, friends518 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated519 'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.520 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id521 522 'meta_query' => false, // filter on activity meta. See WP_Meta_Query for format541 'user_id' => $user_id, // user_id to filter on 542 'object' => $object, // object to filter on e.g. groups, profile, status, friends 543 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated 544 'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. 545 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id 546 547 'meta_query' => false, // filter on activity meta. See WP_Meta_Query for format 523 548 524 549 // Searching 525 'search_terms' => false, // specify terms to search on550 'search_terms' => false, // specify terms to search on 526 551 'update_meta_cache' => true, 527 552 ); … … 618 643 619 644 $template_args = array( 620 'page' => $page,621 'per_page' => $per_page,622 'page_arg' => $page_arg,623 'max' => $max,624 'sort' => $sort,625 'include' => $include,626 'exclude' => $exclude,627 'in' => $in,628 'filter' => $filter,629 'search_terms' => $search_terms,630 'meta_query' => $meta_query,631 'display_comments' => $display_comments,632 'show_hidden' => $show_hidden,633 'spam' => $spam,645 'page' => $page, 646 'per_page' => $per_page, 647 'page_arg' => $page_arg, 648 'max' => $max, 649 'sort' => $sort, 650 'include' => $include, 651 'exclude' => $exclude, 652 'in' => $in, 653 'filter' => $filter, 654 'search_terms' => $search_terms, 655 'meta_query' => $meta_query, 656 'display_comments' => $display_comments, 657 'show_hidden' => $show_hidden, 658 'spam' => $spam, 634 659 'update_meta_cache' => $update_meta_cache, 635 660 );
Note: See TracChangeset
for help on using the changeset viewer.