facetwp modify facet count

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php

/** removes () from count, could also be used to replace with alternate bracketing or other output **/

add_filter( ‘facetwp_facet_html’, function( $output, $params ) {
if ( ‘product_categories’ == $params[‘facet’][‘name’] ) {
$output = preg_replace( ‘/(([0-9]+))/’, ‘$1’, $output );
}
return $output;
}, 10, 2 );
{{/gist}}