bp_friends_filter_folder_scope (数组retval美元=数组(),数组美元的过滤器=数组())
在“朋友”范围内设置媒体参数。
描述
具体语法请参见BP_Media_Query.
参数
- retval美元
-
(数组)(可选)默认为空数组。
默认值:数组()
- 美元的过滤器
-
(数组)(可选)当前活动的观点。
默认值:数组()
返回
(数组)
源
文件:bp-friends / bp-friends-filters.php
function bp_friends_filter_folder_scope($retval = array(), $filter = array()){//确定user_id。如果(!空(过滤器[' user_id美元 '] ) ) { $ user_id = (int)美元过滤器(“user_id”);} else {$user_id = bp_displayed_user_id() ?bp_displayed_user_id (): bp_loggedin_user_id ();} $folder_id = 0;数组$文件夹= ();如果(!$filter['folder_id'] = (int) $filter['folder_id'];} //确定用户的好友 $friends = friends_get_friend_user_ids( $user_id ); if ( empty( $friends ) ) { $friends = array( 0 ); } if ( $user_id !== bp_loggedin_user_id() ) { array_push( $friends, bp_loggedin_user_id() ); } if ( ! empty( $filter['search_terms'] ) ) { if ( ! empty( $folder_id ) ) { $folder_ids = array(); $user_root_folder_ids = bp_document_get_folder_children( (int) $folder_id ); if ( $user_root_folder_ids ) { foreach ( $user_root_folder_ids as $single_folder ) { $single_folder_ids = bp_document_get_folder_children( (int) $single_folder ); if ( $single_folder_ids ) { array_merge( $folder_ids, $single_folder_ids ); } array_push( $folder_ids, $single_folder ); } } $folder_ids[] = $folder_id; $folders = array( 'column' => 'parent', 'compare' => 'IN', 'value' => $folder_ids, ); } } else { $folders = array( 'column' => 'parent', 'value' => 0, ); } if ( ! bp_is_profile_document_support_enabled() ) { $friends = array( 0 ); } $args = array( 'relation' => 'AND', array( 'column' => 'user_id', 'compare' => 'IN', 'value' => (array) $friends, ), array( 'column' => 'privacy', 'compare' => '=', 'value' => 'friends', ), $folders, ); return $args; }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.1.9 | 介绍了。 |