Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter DarkLevi

    (@darklevi)

    did it:

    $args = array(
    			'count_total' => false,
    			'number'      => (int) $_POST['limit'],
    			'search'      => "{$search_query}*"
    		);

    to

    $args = array(
    			'count_total' => false,
    			//'number'      => (int) $_POST['limit'],
    			'search'      => "{$search_query}*"
    		);

    and

    $user_search_results = get_users( $args );
    		if ( empty( $user_search_results ) ) {

    to

    $user_search_results_multiple = get_users( $args );
    		$user_search_results = array_unique($user_search_results_multiple, SORT_REGULAR);
    		if ( empty( $user_search_results ) ) {

    =)

    Thread Starter DarkLevi

    (@darklevi)

    $args = array(
    			'count_total' => false,
    			'number'      => (int) $_POST['limit'],
    			'search'      => "{$search_query}*"
    		);

    instead of commenting out
    'number' => (int) $_POST['limit'],
    you can put the number of suggestions maximal shown

    Thread Starter DarkLevi

    (@darklevi)

    instead of commenting out
    'number' => (int) $_POST['limit'],
    you can put the number of suggestions maximal shown

    even not working cause every entry will be fetched over 30 times, so do this:

    $user_search_results_multiple = get_users( $args );
    		$user_search_results = array_unique($user_search_results_multiple, SORT_REGULAR);
    		array_splice($user_search_results, 6(number of entries shown));
    		if ( empty( $user_search_results ) ) {
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Autosuggest shows user multiple times’ is closed to new replies.