• I want to create an Autocomplete function in WordPress. I want a search field from where Username can be searched. I am using following JQuery UI.

    <label>Users</label>
    
    <input type="text" name="user_name" id="user-name" />
    
    <?php
    
    $get_arr_user = array('John', 'Rogers', 'Paul', 'Amanda', 'Peter');
    
    ?>
    
    <script>
    
    jQuery(document).ready(function($) {                                
    var availableTags = <?php echo json_encode($get_arr_user); ?>;
    $( "#user-name" ).autocomplete({
    source: availableTags
    });
    });
    
    </script>

    My problem is that I am not able to get the list of Username in this format – array('John', 'Rogers', 'Paul', 'Amanda', 'Peter');

    Plz help me in getting the list of Username in array(). Thanks..

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get WordPress Username in Array format’ is closed to new replies.