Created
May 18, 2018 13:11
-
-
Save djrmom/4c88db4a28b9132b710ef0c72718a2cb to your computer and use it in GitHub Desktop.
facetwp modify facet count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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