As above guys, I'm trying to build an AJAX search that works within BuddyPress WITHOUT modifying core code, but that allows me to use a wildcard when I'm searching by username.
Any suggestions?
|
As above guys, I'm trying to build an AJAX search that works within BuddyPress WITHOUT modifying core code, but that allows me to use a wildcard when I'm searching by username. Any suggestions? |
|||
|
|
|
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 );
} |
|||
|