code: function(select, option, type) {
          // Add disabled attr if disabled
          var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';
          var optgroupClass = (type === 'optgroup-option') ? 'optgroup-option ' : '';
          var multipleCheckbox = multiple ? '<input type="checkbox"' + disabledClass + '/><label></label>' : '';
  
          // add icons
          var icon_url = option.data('icon');
          var classes = option.attr('class');
          if (!!icon_url) {
            var classString = '';
            if (!!classes) classString = ' class="' + classes + '"';
  
            // Check for multiple type.
            options.append($('<li class="' + disabledClass + optgroupClass + '"><img alt="" src="' + icon_url + '"' + classString + '><span>' + multipleCheckbox + option.html() + '</span></li>'));
            return true;
          }
  
          // Check for multiple type.
          options.append($('<li class="' + disabledClass + optgroupClass + '"><span>' + multipleCheckbox + option.html() + '</span></li>'));
        }
docs: Function that renders and appends the option taking into account type and possible image icon.