Created
April 18, 2016 12:47
-
-
Save mgibbs189/56b8710e9581a8fe17fdb34bb2d9028b to your computer and use it in GitHub Desktop.
FacetWP - set end date to start date if necessary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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