Customer user query conflict?
-
Hello, I have added a custom pre_user_query to increase the search user speed, will it conflict with your plugin?
add_action('pre_user_query','rudr_extend_user_search'); function rudr_extend_user_search( $u_query ){ if ( $u_query->query_vars['search'] ){ $search_query = trim( $u_query->query_vars['search'], '*' ); if ( $_REQUEST['s'] == $search_query ){ global $wpdb; $search_by = array( 'user_login','display_name'); $u_query->query_where = 'WHERE 1=1' . $u_query->get_search_sql( $search_query, $search_by, 'both' ); } } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Customer user query conflict?’ is closed to new replies.