Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter Autocomplete IDs?

  • @andrewteg

    Participant

    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 4 replies - 1 through 4 (of 4 total)
  • @shanebp

    Moderator

    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

    @andrewteg

    Participant

    Thanks! Thought I was going crazy 🙂

    @honoluluman

    Participant

    hello @andrewteg, i am trying to do the same. Did you figure it out?

    @andrewteg

    Participant

    Nope, I’d start a new thread about it.

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