mgibbs189

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

function fwp_index_gauge( $params, $class ) {
if ( ‘gauge’ == $params[‘facet_name’] ) {
$data_array = $params[‘facet_value’];
if ( isset( $data_array[‘gauge-thickness’] ) ) {
$values = explode( ‘ | ‘, $data_array[‘gauge-thickness’][‘value’] );
foreach ( $values as $val ) {
$params[‘facet_value’] = $val; // automatically sanitized
$params[‘facet_display_value’] = $val;
$class->insert( $params );
}
}
return false; // prevent default indexing for this facet
}
return $params;
}

add_filter( ‘facetwp_index_row’, ‘fwp_index_gauge’, 10, 2 );
{{/gist}}