Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * acf.newSelect2
- *
- * description
- *
- * @date 13/1/18
- * @since 5.6.5
- *
- * @param type $var Description. Default.
- * @return type Description.
- */
- acf.newSelect2 = function( $select, props ){
- // defaults
- props = acf.parseArgs(props, {
- allowNull: false,
- placeholder: '',
- multiple: false,
- field: false,
- ajax: false,
- ajaxAction: '',
- ajaxData: function( data ){ return data; },
- ajaxResults: function( json ){ return json; },
- });
- // initialize
- if( getVersion() == 4 ) {
- var select2 = new Select2_4( $select, props );
- } else {
- var select2 = new Select2_3( $select, props );
- }
- // actions
- acf.doAction('new_select2', select2);
- // return
- return select2;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement