bp_activity_get (|字符串数组args美元='')
检索一个或多个活动。
描述
的bp_activity_get ()函数共享所有参数BP_Activity_Activity: get ().下面是一个列表bp_activity_get ()具有不同默认值的参数BP_Activity_Activity: get ()的默认值bp_activity_get ()).
- “per_page”(假)
另请参阅
- BP_Activity_Activity: get ():有关接受的参数和返回值格式的更多信息。
参数
- args美元
-
(数组|字符串)(可选)看到BP_Activity_Activity: get ()为描述。
默认值:“
返回
(数组)活动看到美元BP_Activity_Activity: get ()为描述。
源
文件:bp-activity / bp-activity-functions.php
function bp_activity_get($args = ") {$r = bp_parse_args($args, array('max' => false, //最大返回的结果数。'fields' => 'all', 'page' => 1, //没有per_page的page 1将不会导致分页。'per_page' => false, //每个页面的结果'sort' => 'DESC', //排序ASC或DESC' display_comments' => false, // false为没有注释。'stream'表示在流中显示,' threading '表示在每个活动项下面。'privacy' => false, //活动的隐私'search_terms' => false, //通过搜索条款作为一个字符串'meta_query' => false, //活动的meta过滤。format 'date_query' => false, //按日期过滤。格式见WP_Date_Query的第一个参数。'filter_query' => false, 'show_hidden' => false, //显示隐藏在整个站点的活动项?'exclude' => false, //以逗号分隔的要排除的活动id列表。'in' => false, //逗号分隔的活动id列表或数组,你//想要限制查询。 'spam' => 'ham_only', // 'ham_only' (default), 'spam_only' or 'all'. 'update_meta_cache' => true, 'count_total' => false, 'scope' => false, /** * Pass filters as an array -- all filter items can be multiple values comma separated: * array( * 'user_id' => false, // User ID to filter on. * 'object' => false, // Object to filter on e.g. groups, profile, status, friends. * 'action' => false, // Action to filter on e.g. activity_update, profile_updated. * 'primary_id' => false, // Object ID to filter on e.g. a group_id or blog_id etc. * 'secondary_id' => false, // Secondary object ID to filter on e.g. a post_id. * ); */ 'filter' => array() ), 'activity_get' ); $activity = BP_Activity_Activity::get( array( 'page' => $r['page'], 'per_page' => $r['per_page'], 'max' => $r['max'], 'sort' => $r['sort'], 'privacy' => $r['privacy'], 'search_terms' => $r['search_terms'], 'meta_query' => $r['meta_query'], 'date_query' => $r['date_query'], 'filter_query' => $r['filter_query'], 'filter' => $r['filter'], 'scope' => $r['scope'], 'display_comments' => $r['display_comments'], 'show_hidden' => $r['show_hidden'], 'exclude' => $r['exclude'], 'in' => $r['in'], 'spam' => $r['spam'], 'update_meta_cache' => $r['update_meta_cache'], 'count_total' => $r['count_total'], 'fields' => $r['fields'], ) ); /** * Filters the requested activity item(s). * * @since BuddyPress 1.2.0 * * @param BP_Activity_Activity $activity Requested activity object. * @param array $r Arguments used for the activity query. */ return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 1.2.0 | 介绍了。 |