Trim values to 50 characters

mgibbs189

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

<?php
// Add the following to your theme’s functions.php
add_filter( ‘facetwp_index_row’, function( $params, $class ) {
if ( ‘aufsichtsbehoerden’ == $params[‘facet_name’] ) {
$raw_value = $params[‘facet_value’];
if ( 50 < strlen( $raw_value ) ) {
$params[‘facet_value’] = substr( $raw_value, 0, 50 ); // cut off some of the value
}
}
return $params;
}, 10, 2 );
{{/gist}}