[wp-hackers] Wp_Query and wildcards

Lox lox.dev at knc.nc
Thu Aug 19 19:33:33 UTC 2010


2010/8/20 Andrew Nacin <wp at andrewnacin.com>

> You should use like_escape(), in case your search has % or _ in it, as
> those
> need to be escaped.
>

I'll look at it thks. For now, I have in a posts_where hook:

if( !empty($query_vars['sec']) )
>                 $where .= " AND dominante LIKE '%" .
> esc_sql($query_vars['sec']) ."%'";
>

Witch works as it.

-- 
Lox
lox.dev at knc.nc


More information about the wp-hackers mailing list