New WordPress plugin: Add User Autocomplete

Add User Autocomplete

Add User Autocomplete

Site admins on a WordPress Network can add existing network members to their site on the Dashboard > Users > Add New panel. But the interface requires that one know either the email address or the username of the user in question. My new plugin, Add User Autocomplete, makes the Add Existing User workflow a bit easier, by adding autocomplete/autosuggest to the Email Address/Username field. Just start typing, and the plugin will return matching users; arrow down or click on the intended user to add her to the Add User list.

A few additional bonuses provided by the plugin, aside from autocomplete:

  • In addition to return email address and username matches, the plugin also checks against the display_name and user_url fields. So if my username is ‘admin’, and my email address is ‘bgorges@boonebgorges.com’, but my display name around the site is ‘Boone Gorges’, you’ll be able to find me by searching on ‘Boone’.
  • You can add many users to a blog at once. Search for one user, select and hit Return, and then search for another.
  • Prettier success messages. When you submit the Add New User page, your success message will give you a list of the users invited, instead of a generic “Invitations have been sent” type message.

Add User Autocomplete requires WP 3.1 and JavaScript. The plugin was developed for the CUNY Academic Commons. Check out the plugin at wordpress.org or follow its development at Github.

New WordPress plugin: Add User Autocomplete by Boone Gorges, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

4 thoughts on “New WordPress plugin: Add User Autocomplete

    1. Boone Gorges Post author

      Yeah, I’ll work on it. I’ll have to rewrite it to use 3.3′s packaged jQueryUI autocomplete. I’ll probably submit another enhancement that allows for WP_User_Query’s search_terms to query display_name as well, though it’s not really crucial for this plugin to work. Thanks for the prod.

      Reply
      1. Andrew Nacin

        display_name isn’t indexed, which is why WP_User_Query doesn’t support it for searching. It’s a deliberate omission.

        Unfortunately a core feature will need to rely on usernames and emails.

        That said, we do have a way of identifying large networks (> 10,000 sites, or > 10,000 users, depending on what why we want to know). Perhaps display_name can be added for “small” networks, assuming the filesort can be shown to not be particularly terrible at that scale.

  1. D'Arcy Norman

    awesome. you rock. I could never figure out why this feature wasn’t built into wordpress from day one… having to know the email address someone used to create their account, in order to add them to a site?

    much better.

    thank you!

    Reply

Leave a Reply