FacetWP – set end date to start date if necessary

mgibbs189

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

function fwp_index_dates( $params, $class ) {
if ( ‘date_range’ == $params[‘facet_name’] ) {
if ( empty( $params[‘facet_display_value’] ) ) { // end date column
$params[‘facet_display_value’] = $params[‘facet_value’];
}
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘fwp_index_dates’, 10, 2 );
{{/gist}}