Wp_user_query search by meta_key not returning any results
I have a search form, and im trying to have it be able to search both the basic user field (user_email, display_name, etc), plus 1 other custom user meta key called "clinic"
heres the argument i have so far
$args = array(
'orderby' = 'display_name',
'meta_key' = 'course',
'fields' = 'all',
'search' = $search,
'meta_query' = array(
array(
'key' = 'clinic',
'value' = $search,
'compare' = 'LIKE'
)
)
);
Also, not sure if i have this set up correctly, but i also need the query to check if the meta key "course" exists, regardless of its value (but this is secondary, and can be removed if it might cause problems, im mostly concerned with it searching the clinic meta key)
Topic wp-user-query Wordpress
Category Web