Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created May 18, 2018 13:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/4c88db4a28b9132b710ef0c72718a2cb to your computer and use it in GitHub Desktop.
Save djrmom/4c88db4a28b9132b710ef0c72718a2cb to your computer and use it in GitHub Desktop.
facetwp modify facet count
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment