-
I want the main search box on the memberlist filters to search BOTH the
display_name
anddescription
variables to see if that word is anywhere in either of those two fields. I had to go into the code and change line 158 of functions>memberlist-functions.php to say'compare' => 'like'
instead of'compare' => '='
In my shortcode I havememberlist_filters="description,display_name"
I remove “display_name” from that filters and it works fine, minus the searching in the display_name.
When I put it back to both, it returns ALL users PLUS ONE. (ie I have 20 regular members, when I search it shows 21 members found). I found the code (as stated above) but nothing I try works.Any help??
I figured something out. I have roles set.
In my shortcode I have the following:
role="ai1ec_event_assistant"
to show up just members, not staff (which are contributors.When I change line 152 which is:
$query['meta_query']['relation'] = 'OR';
to this:$query['meta_query']['relation'] = 'AND';
It works as it should, pulling up non-staf that have the search string in BOTH their display name and description.
But I don’t want that, I want it to be display name and/or description (which is the use of ‘OR’ as the relation).But when I set it to OR… ALL of my regular members show up, and the search actually applies to the staff members.
I figured this is because staff members can still edit events (as role is above). So I set my role to this:
role="ai1ec_event_assistant,subscriber"
which pulls up correctly all my non-staff members (which I found some members are currently under Subscriber only.
HOWEVER now the search won’t work properly. I have it at ‘AND’ and it doesn’t work at all. I changed it back to ‘OR’ but now it kind of works, with the exception that the pagination is all wrong! It says 4 members found (with three pages) but only pages 1 & 2 have members and 3 is blank (so 8 members total, split on pages 1 and 2).Help please! I need to get this working properly.
So I changed my users to all be under “Event Assistant” instead of Subscriber. But still the searching of multiple filter fields doesn’t work properly.
Please let me know if you guys can help.
Thanks!
You must be logged in to reply to this topic.