Hi @intarwebsdeveloper
Have you tried using the Admin filter in the Member Directory?
Please go to WP Admin > Ultimate Member > Member Directory > Edit/Add a Directory > Scroll at the bottom page and see “Search Options” > see “Admin filtering”. You can add filters as default search filters.
Regards,
Hello @champsupertramp
I did try using the Admin filter and it’s not working the way I need it to. When I choose the City field, it makes me choose a City in order to add the filter. And then the Search will ony query that specific City, which is incorrect. I need the search to only query the City field and (an additional user meta field if possible) instead of searching all the user fields of the profile.
Thanks
Hi @intarwebsdeveloper
Do you want the main search bar in the member directory to search for City and State fields only? We haven’t done this customization so I can only provide hooks that could help you:
Filter hook: `um_prepare_user_query_args’
Parameters: $query_args & $directory_settings
Sample usage:
add_filter("um_prepare_user_query_args","um_012621_prepare_user_query_args", 10, 2 );
function um_012621_prepare_user_query_args( $args, $settings ){
// do something with $args['meta_query'];
return $args;
}
Regards,
Thanks, I’ll try this out.
Hey there!
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂
Regards,