Skip to content
Snippets Groups Projects
Select Git revision
  • caeee14caa4e7c7bddf50752fb2c725f906f9f01
  • noblogs default
  • noblogs-5.7.1
  • upstream
  • noblogs-5.7
  • noblogs-5.6new
  • upstream5.5.1
  • noblogs28dic
  • upstream28dic
  • noblogs-5.5.1
  • noblogs-5.4.2
  • noblogs-5.4_seconda
  • noblogs-5.4
  • noblogs-7c
  • wp5.2.3p3
  • mergedbconf
  • noblogs-5.7.1
  • noblogs.5.7.0p1
  • noblogs-5.7.0
  • noblogs-5.6p3
  • noblogs5.6p2
  • noblogs-5.6p1
  • noblogs-5.6
  • noblogs-5.4.2p1
  • noblogs-5.4.2
  • noblogs-5.4.1
  • noblogs-5.4
  • noblogs-p5.4
  • noblogs-5.3.2p2
  • noblogs-5.3.2p1
  • noblogs-5.3.2
  • noblogs-5.3
  • noblogs-5.2.3p4
  • noblogs-5.2.3p3
  • noblogs-5.2.3p2
  • noblogs-5.2.3p1
36 results

class-wp-customize-widgets.php

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 );