BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you so much Ravi for your help 🙂

    Yes the code worked just fine.

    How can i exlcude from the results the current user, so that he doesn’t have the option to find him self?

    I have tried something like that

    function buddydev_filter_buddypress_auto_complete_ids( $args ) {
    
    	if ( ! function_exists( 'bp_featured_members' ) ) {
    		return $args;
    	}
    	
        if ( is_user_logged_in() ) {
    		$excluded = get_current_user_id();
    	}
    	$args['meta_key'] = '_is_featured';
    
    	return $args;
    }
    
    add_filter( 'bp_members_suggestions_query_args', 'buddydev_filter_buddypress_auto_complete_ids' );