wordpress - Search + Meta Query does not work with AND condition -
search meta query not work "and" condition using custom query.
please check code:
select distinct sql_calc_found_rows wp_users.* wp_users inner join wp_usermeta on ( wp_users.id = wp_usermeta.user_id ) 1=1 , ( ( wp_usermeta.meta_key = 'user_mobile1' , cast(wp_usermeta.meta_value char) '%98%' ) or ( wp_usermeta.meta_key = 'user_mobile2' , cast(wp_usermeta.meta_value char) '%98%' ) , ( wp_usermeta.meta_key = '_entry_status' , cast(wp_usermeta.meta_value char) '%female%' ) ) order display_name desc
issue:
when search user mobile number works. , search meta_value "female" working fine.
but need both filtering if search mobile number , female records. query not work , display wrong data.
please me mistake in code.
thank you.
Comments
Post a Comment