FacetWP – index element within serialized array

mgibbs189

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

function fwp_index_price_range( $params, $class ) {
if ( ‘price_range’ == $params[‘facet_name’] ) {
$cf = (array) $params[‘facet_value’]; // already unserialized
$params[‘facet_value’] = $cf[‘seek_property_price’];
$params[‘facet_display_value’] = $cf[‘seek_property_price’];
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘fwp_index_price_range’, 10, 2 );
{{/gist}}