FacetWP – automatically decode HTML entities for Autocomplete facets

mgibbs189

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

function fwp_decode_entities( $params, $class ) {
if ( ‘my_autocomplete’ == $params[‘facet_name’] ) {
$params[‘facet_value’] = html_entity_decode( $params[‘facet_value’] );
$params[‘facet_display_value’] = html_entity_decode( $params[‘facet_display_value’] );
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘fwp_decode_entities’, 10, 2 );
{{/gist}}