Created
August 19, 2016 12:20
-
-
Save marktoce/6812bd364b978c629522953d8e974dbb to your computer and use it in GitHub Desktop.
WPFacet date formating
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
// The keys correspond with columns in the `facetwp_index` table | |
$dateparams = array( | |
'facet_name' => 'keydate' | |
); | |
//change the way the date works for key date on calendar page | |
function my_facetwp_calendar_row( $dateparams, $class ) { | |
if ( 'keydate' == $dateparams['facet_name'] ) { | |
$raw_value = $dateparams['facet_value']; | |
$dateparams['facet_display_value'] = date( 'm/j/Y', strtotime( $raw_value ) ); | |
} | |
return $dateparams; | |
} | |
add_filter( 'facetwp_calendar_row', 'my_facetwp_calendar_row', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment