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

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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

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.