Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter Autocomplete IDs?


  • Andrew Tegenkamp
    Participant

    @andrewteg

    I am trying to filter autocomplete IDs in Message to just a certain role or member type based on the user’s role or member type. Sometimes they are not friends so I tried setting BP_MESSAGES_AUTOCOMPLETE_ALL and it works great to get everyone but I can’t find how to filter it. I’m trying this just to see what I have to work with but it doesn’t seem to fire:


    define('BP_MESSAGES_AUTOCOMPLETE_ALL', 1);
    add_filter('bp_friends_autocomplete_ids', 'my_autocomplete', 10, 3);
    function my_autocomplete($data, $string, $limit) {
    print_r($data);
    print_r($string);
    print_r($limit);
    }

    Any ideas?

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

  • shanebp
    Moderator

    @shanebp

    That filter is only in the default BP theme.
    Unless you are specifically using that theme, the filter will not be present.

    The legacy theme doesn’t have the same filter.
    Try using this filter bp_members_suggestions_get_suggestions
    found in bp-core\classes\class-bp-members-suggestions.php


    Andrew Tegenkamp
    Participant

    @andrewteg

    Thanks! Thought I was going crazy 🙂

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