Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restricting messaging search to just name and username


  • bojates
    Participant

    @bojates

    I’m having a problem with the messaging in BuddyPress. When I search for a user in Compose, to send them a message, they quite often don’t appear in the dropdown list of users.

    I am pretty sure this is because the ajax search bp_get_suggestions is checking the extended user fields as well as the name and username fields. My members are referred by other members, so many of them have another user’s name in one of their extended user fields. This means a search for ‘@jane’ will bring back all the users who have been referred by Jane before it brings back Jane herself. And because it’s alphabetical, we don’t get to Jane herself.

    Is there a way to restrict the fields that get searched for this messaging functionality?

    Thanks,

    Jemima

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    For private messages, auto-complete only shows your friends.
    To access everyone, put this in your theme/functions.php or in plugins/bp-custom.php
    define( 'BP_MESSAGES_AUTOCOMPLETE_ALL', true );

    To customize the options provided by autocomplete, you would need to write some custom code.


    bojates
    Participant

    @bojates

    Thanks. I’m not using the Friends module, and I’m not finding an issue with the private messaging returning results. It’s just the full range of profile fields being searched, I think, that’s causing the problem with too broad a search result.

    I am happy to write some custom code. Has anyone got some pointers on where to start?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar