Skip to content
Snippets Groups Projects
Select Git revision
  • 7cff2e8d38a30274c7cfc352c3f1d6c70cf9ecd8
  • master default protected
  • renovate/golang.org-x-net-0.x
  • renovate/golang.org-x-crypto-0.x
  • renovate/git.autistici.org-ai3-go-common-digest
  • renovate/github.com-miekg-dns-1.x
  • renovate/github.com-prometheus-client_golang-1.x
  • v3
  • v2
9 results

provider.go

Blame
  • user-suggest.js 1.04 KiB
    /* global ajaxurl, current_site_id, isRtl */
    
    (function( $ ) {
    	var id = ( typeof current_site_id !== 'undefined' ) ? '&site_id=' + current_site_id : '';
    	$(document).ready( function() {
    		var position = { offset: '0, -1' };
    		if ( typeof isRtl !== 'undefined' && isRtl ) {
    			position.my = 'right top';
    			position.at = 'right bottom';
    		}
    		$( '.wp-suggest-user' ).each( function(){
    			var $this = $( this ),
    				autocompleteType = ( typeof $this.data( 'autocompleteType' ) !== 'undefined' ) ? $this.data( 'autocompleteType' ) : 'add',
    				autocompleteField = ( typeof $this.data( 'autocompleteField' ) !== 'undefined' ) ? $this.data( 'autocompleteField' ) : 'user_login';
    
    			$this.autocomplete({
    				source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=' + autocompleteType + '&autocomplete_field=' + autocompleteField + id,
    				delay:     500,
    				minLength: 2,
    				position:  position,
    				open: function() {
    					$( this ).addClass( 'open' );
    				},
    				close: function() {
    					$( this ).removeClass( 'open' );
    				}
    			});
    		});
    	});
    })( jQuery );