Support » Plugin: BP Profile Search » Filtering roles

  • Resolved pgDarkness

    (@pgdarkness)



    Hi there and thank you for making life for wordpress+buddypress users much more enjoyable. 👌

    I had a code to limit search results of buddypress member search to only one specific role which doesn’t work anymore because of added args by your plugin.
    Can you extend this plugin to cover this? It would be awesome to have a filter option to limit search results of this and buddypress simple member search to specific roles or atleast give me some directions to fix my problem, that would be even more awesome. 😁

    Here is my old code:

    function modify_members_loop( $qs=false, $object=false ) {
        if ( $object != 'members' )
            return $qs;
        $sellers =  get_users( 'fields=ID&role=seller' );
        $args['include'] =  $sellers;
        $qs = build_query($args);
        return $qs;
    }
    add_action( 'bp_ajax_querystring' , 'modify_members_loop', 25, 2 );
    • This topic was modified 7 months ago by  pgDarkness.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi @pgdarkness,

    Your code is working for me.

    What changed in your site right before it stopped working? Are there other codes or plugins filtering the members directory?

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hello @pgdarkness,

    Actually your code is *not* working for me. Sorry for the wrong answer!

    Try replacing your fifth line with this one:

    $args['include'] = implode (',', $sellers);

    pgDarkness

    (@pgdarkness)

    Hi there @dontdream,

    That worked! Thanks!

    Sorry for late reply, I was a bit busy these a few days.
    Thanks for digging into it and finding that extra arg problem. You saved my night.

    Also thank you for fast response. Respect for caring plugin authors. #You_rock !

    PS: Filtering results by role would still be an awesome feature thou.

    Plugin Author Andrea Tarantini

    (@dontdream)

    Great, I’m glad it works!

    And I’m adding the filter by role feature to my to-do list.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filtering roles’ is closed to new replies.