Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. /**
  2. * acf.newSelect2
  3. *
  4. * description
  5. *
  6. * @date 13/1/18
  7. * @since 5.6.5
  8. *
  9. * @param type $var Description. Default.
  10. * @return type Description.
  11. */
  12.  
  13. acf.newSelect2 = function( $select, props ){
  14.  
  15. // defaults
  16. props = acf.parseArgs(props, {
  17. allowNull: false,
  18. placeholder: '',
  19. multiple: false,
  20. field: false,
  21. ajax: false,
  22. ajaxAction: '',
  23. ajaxData: function( data ){ return data; },
  24. ajaxResults: function( json ){ return json; },
  25. });
  26.  
  27. // initialize
  28. if( getVersion() == 4 ) {
  29. var select2 = new Select2_4( $select, props );
  30. } else {
  31. var select2 = new Select2_3( $select, props );
  32. }
  33.  
  34. // actions
  35. acf.doAction('new_select2', select2);
  36.  
  37. // return
  38. return select2;
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement