Replace facet counts with “10+” if the count is > 10

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_filter( ‘facetwp_facet_render_args’, function( $args ) {
if ( isset( $args[‘values’] ) && isset( $args[‘values’][0][‘counter’] ) ) {
foreach ( $args[‘values’] as $key => $val ) {
if ( $val[‘counter’] > 10 ) {
$args[‘values’][ $key ][‘counter’] = ’10+’;
}
}
}
return $args;
});

{{/gist}}