Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created April 18, 2016 12:47
Show Gist options
  • Save mgibbs189/56b8710e9581a8fe17fdb34bb2d9028b to your computer and use it in GitHub Desktop.
Save mgibbs189/56b8710e9581a8fe17fdb34bb2d9028b to your computer and use it in GitHub Desktop.
FacetWP - set end date to start date if necessary
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment