Changeset 42708
- Timestamp:
- 02/13/2018 03:37:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/user-suggest.js
r27046 r42708 1 1 /* global ajaxurl, current_site_id, isRtl */ 2 /** 3 * Suggests users in a multisite environment. 4 * 5 * For input fields where the admin can select a user based on email or 6 * username, this script shows an autocompletion menu for these inputs. Should 7 * only be used in a multisite environment. Only users in the currently active 8 * site are shown. 9 * 10 * @since 3.4.0 11 */ 2 12 3 13 (function( $ ) { … … 9 19 position.at = 'right bottom'; 10 20 } 21 22 /** 23 * Adds an autocomplete function to input fields marked with the class 24 * 'wp-suggest-user'. 25 * 26 * A minimum of two characters is required to trigger 27 * the suggestions. The autocompletion menu is shown at the left bottom of the input 28 * field. On RTL installations, it is shown at the right top. 29 * Adds the class 'open' to the input field when the autocompletion menu 30 * is shown. 31 * 32 * Does a backend call to retrieve the users. 33 * 34 * Optional data-attributes: 35 * - data-autocomplete-type (add, search) 36 * The action that is going to be performed: search for existing users 37 * or add a new one. Default: add 38 * - data-autocomplete-field (user_login, user_email) 39 * The field that is returned as the value for the suggestion. 40 * Default: user_login 41 * 42 * @see wp-admin/includes/admin-actions.php:wp_ajax_autocomplete_user() 43 */ 11 44 $( '.wp-suggest-user' ).each( function(){ 12 45 var $this = $( this ),
Note: See TracChangeset
for help on using the changeset viewer.