For anyone looking, select2 has changed maximumSelectionSize
to maximumSelectionLength
. An updated version of the above:
(function($) {
acf.add_filter('select2_args', function( args, $select, settings ){
// limit to 3
args.maximumSelectionLength = 3;
return args;
});
})(jQuery);