Home › Forums › Backend Issues (wp-admin) › select2_args › Reply To: select2_args
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;
});
}
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.