• Resolved samhay

    (@samhay)


    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)
  • Plugin Author OllieJones

    (@olliejones)

    It looks like this action removes the wildcards at the beginning and end of any search term, for example changing *mullenweg* to mullenweg. I don’t believe that interferes with my plugin. If it does please let me know.

    For what it’s worth, you’ll get the same MySQL performance increase if you only remove the leading *.

    Thread Starter samhay

    (@samhay)

    Thank you very much for your reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customer user query conflict?’ is closed to new replies.