FacetWP – limit characters for the Builder “Post Excerpt” item

mgibbs189

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

add_filter( ‘facetwp_builder_item_value’, function( $value, $item ) {
if ( ‘post_excerpt’ == $item[‘source’] ) {
$value = substr( $value, 0, 120 ); // limit to 120 characters
}
return $value;
}, 10, 2 );
{{/gist}}