• Resolved nilsfischerinfo

    (@nilsfischerinfo)


    Hello and thanks for the greate plugin.

    I added a Search Form to my Buddypress Members Directory with a couple of fields like Keyword or Country. It works well. And I added a Checkbox list filter for the roles. Now all roles are displayed in the filter. Like Admin, Editor, Subscriber, Member, Old_Member, New_Member etc. I just need two or three of them in the filter. Is there any possibility to slice or hide a couple of values. So that I just have Member and Old_Member in my filter option. May I can add some code in the functions.php

    Thanks for you help and your great work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi nilsfischerinfo,

    Try adding this code to your bp-custom.php (or functions.php):

    add_action ('bps_edit_field', 'set_role_names');
    function set_role_names ($f)
    {
    	if ($f->code == 'role' || $f->code == 'roles')
    	{
    		unset ($f->options['administrator']);
    		unset ($f->options['...']);
    		unset ($f->options['...']);
    	}
    }

    Add as many unset() as needed, replacing '...' with the role name you wish to remove.

    Thread Starter nilsfischerinfo

    (@nilsfischerinfo)

    Hi,

    thanks for the fast Support. Works perfect.

    Have a nice Weekend.

    All the best.

    Plugin Author Andrea Tarantini

    (@dontdream)

    You are welcome!

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

The topic ‘Hide roles in filter’ is closed to new replies.