I found the following class in the add user autocomplete plugin . It extends the normal searcha and allows ‘*’;
Example: $wp_user_search = new A2B_User_Query( array( ‘search’ => $s . ‘*’ ) ) ;
class A2B_User_Query extends WP_User_Query {
/**
* @see WP_User_Query::get_search_sql()
*/
function get_search_sql( $string, $cols, $wild = false ) {
$string = esc_sql( $string );
// Always search all columns
$cols = array(
'user_email',
'user_login',
'user_nicename',
'user_url',
'display_name'
);
// Always do 'both' for trailing_wild
$wild = 'both';
$searches = array();
$leading_wild = ( 'leading' == $wild || 'both' == $wild ) ? '%' : '';
$trailing_wild = ( 'trailing' == $wild || 'both' == $wild ) ? '%' : '';
foreach ( $cols as $col ) {
if ( 'ID' == $col )
$searches[] = "$col="$string"";
else
$searches[] = "$col LIKE '$leading_wild" . like_escape($string) . "$trailing_wild'";
}
return ' AND (' . implode(' OR ', $searches) . ')';
}
}