So, according to this https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/. How does one do this actually? Anyone know? I am trying to figure out how to add a class to the select2-drop element. Not much information on the page about actually doing anything.
To answer my own question
(function($){
// make sure acf is loaded
if (typeof acf.add_filter !== 'undefined') {
// this basically adds the filter to all fields that use select2
acf.add_filter('select2_args', function(args, element, settings) {
// look at the current element
// test for something in the fields we want to modify
if (element.hasClass('glyphicons-select') ||
element.hasClass('glyphicon_selector')) {
// if it's our field add something to args
args['dropdownCss']['font-family'] = 'Glyphicons Regular';
}
return args;
});
}
}