bp_nouveau_get_notifications_filters()
Get the notifications filter options.
Return Return
(string) HTML output.
Source Source
File: bp-templates/bp-nouveau/includes/notifications/template-tags.php
function bp_nouveau_get_notifications_filters() { $output = ''; $filters = bp_nouveau_notifications_sort( bp_nouveau_notifications_get_filters() ); $selected = 0; if ( ! empty( $_REQUEST['type'] ) ) { $selected = sanitize_key( $_REQUEST['type'] ); } foreach ( $filters as $filter ) { if ( empty( $filter['id'] ) || empty( $filter['label'] ) ) { continue; } $output .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( sanitize_key( $filter['id'] ) ), selected( $selected, $filter['id'], false ), esc_html( $filter['label'] ) ) . "\n"; } if ( $output ) { $output = sprintf( '<option value="%1$s" %2$s>%3$s</option>', 0, selected( $selected, 0, false ), esc_html__( '— Everything —', 'buddypress' ) ) . "\n" . $output; } /** * Filter to edit the options output. * * @since 3.0.0 * * @param string $output The options output. * @param array $filters The sorted notifications filters. */ return apply_filters( 'bp_nouveau_get_notifications_filters', $output, $filters ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |