bp_get_activity_filter_links (数组| boolargs美元=假)
返回活动筛选器链接。
描述
参数
- args美元
-
(数组|保龄球)(可选)
- “风格”
(字符串)用于链接的标记类型。'list', 'paragraph'或'span'。默认值:“列表”。
默认值:假
- “风格”
返回
(字符串| bool)$component_links活动过滤器链接。;如果执行失败将返回False。
源
文件:bp-activity / bp-activity-template.php
函数bp_get_activity_filter_links($args = false) {$r = wp_parse_args($args, array('style' => 'list'));//定义局部变量数组$ component_links = ();//获取在DB中记录有活动的组件的名称。$ = BP_Activity_Activity:组件:get_recorded_components ();If (empty($components)){返回false;} foreach ((array) $components as $component){//跳过活动评论过滤器。If ('activity' == $component){继续;} if (isset($_GET[' filter']) && $component == $_GET[' filter']) {$selected = ' class="selected"';} else {$selected = "; "; } $component = esc_attr( $component ); switch ( $r['style'] ) { case 'list': $tag = 'li'; $before = '
'; $after = '
'; break; case 'span': $tag = 'span'; $before = ''; $after = ''; break; } $link = add_query_arg( 'afilter', $component ); $link = remove_query_arg( 'acpage' , $link ); /** * Filters the activity filter link URL for the current activity component. * * @since BuddyPress 1.1.0 * * @param string $link The URL for the current component. * @param string $component The current component getting links constructed for. */ $link = apply_filters( 'bp_get_activity_filter_link_href', $link, $component ); $component_links[] = $before . '' . ucwords( $component ) . '' . $after; } $link = remove_query_arg( 'afilter' , $link ); if ( isset( $_GET['afilter'] ) ) { $component_links[] = '<' . $tag . ' id="afilter-clear">' . __( 'Clear Filter', 'buddyboss' ) . '' . $tag . '>'; } /** * Filters all of the constructed filter links. * * @since BuddyPress 1.1.0 * @since BuddyPress 2.6.0 Added the `$r` parameter. * * @param string $value All of the links to be displayed to the user. * @param array $r Array of parsed arguments. */ return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ), $r ); }更新日志
版本 | 描述 |
---|---|
BuddyPress 1.1.0 | 介绍了。 |