Support

Account

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;
        });
      }
    }