bp_nouveau_get_notifications_filters()
Get the notifications filter options.
Description
Return
(string) HTML output.
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__( '- View All -', 'buddyboss' )
) . "\n" . $output;
}
/**
* Filter to edit the options output.
*
* @since BuddyPress 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 );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 3.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.