bp_nouveau_get_component_filters (字符串美元的上下文='',字符串美元的组件='')
获取Dropdawn过滤器的当前组件传入参数
描述
参数
- 美元的上下文
-
(字符串)(可选)'目录','用户'或'组'
默认值:“
- 美元的组件
-
(字符串)(可选)BuddyPress组件ID
默认值:“
返回
(数组)下拉过滤器
源
文件:bp-templates / bp-nouveau / /显然也包括
函数bp_nouveau_get_component_filters($context = ", $component = ") {$filters = array();If (empty($context)) {If (bp_is_user()) {$context = '用户';} elseif (bp_is_group()) {$context = '组';//默认目录}else {$context = '目录';}} if (empty($component)) {if ('directory' === $context || 'user' === $context) {$component = bp_current_component();If ('friends' === $component) {$context = 'friends';组件美元=“成员”;}} elseif ('group' === $context && bp_is_group_activity()) {$component = 'activity';} elseif ('group' === $context && bp_is_group_members()) {$component = '成员';}} if (! bp_is_active( $component ) ) { return $filters; } if ( 'members' === $component ) { $filters = bp_nouveau_get_members_filters( $context ); } elseif ( 'activity' === $component ) { $filters = bp_nouveau_get_activity_filters(); // Specific case for the activity dropdown $filters = array_merge( array( '-1' => __( '- View All -', 'buddyboss' ) ), $filters ); } elseif ( 'groups' === $component ) { $filters = bp_nouveau_get_groups_filters( $context ); } elseif ( 'blogs' === $component ) { $filters = bp_nouveau_get_blogs_filters( $context ); } return $filters; }
更新日志
版本 | 描述 |
---|---|
BuddyPress 3.0.0 | 介绍了。 |