bp_search_items()

Buddyboss global search items options

Description

Return

(mixed|void)

Source

File: bp-search/bp-search-functions.php

358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
function bp_search_items() {
 
    $items = array(
        'posts'          => __( 'Blog Posts', 'buddyboss' ),
        'pages'          => __( 'Pages', 'buddyboss' ),
        'posts_comments' => __( 'Post Comments', 'buddyboss' ),
        'members'        => __( 'Members', 'buddyboss' ),
    );
 
    //forums?
 
    $items['forum'] = __( 'Forums', 'buddyboss' );
    $items['topic'] = __( 'Forums Discussions', 'buddyboss' );
    $items['reply'] = __( 'Forums Replies', 'buddyboss' );
 
 
    //other buddypress components
    $bp_components = array(
        'groups'   => __( 'Groups', 'buddyboss' ),
        'activity' => __( 'Activity', 'buddyboss' ),
        'messages' => __( 'Messages', 'buddyboss' ),
        /* should we search notifications as well?
        'notifications' => __( 'Notifications', 'buddyboss' ), */
    );
 
    //only the active ones please!
    foreach ( $bp_components as $component => $label ) {
        if ( function_exists( 'bp_is_active' ) && bp_is_active( $component ) ) {
            $items[ $component ] = $label;
 
            if ( 'activity' === $component ) {
                $items['activity_comment'] = __( 'Activity Comments', 'buddyboss' );
            }
        }
    }
 
    return apply_filters( 'bp_search_items', $items );
}

Changelog

Changelog
Version Description
BuddyBoss 1.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.