<?php
function fwp_index_acf_date( $params, $class ) {
if ( 'vandring_startdatum' == $params['facet_name'] ) {
$raw = $params['facet_value'];
if ( 8 == strlen( $raw ) ) {
$date_fixed = substr( $raw, 0, 4 ) . '-' . substr( $raw, 4, 2 ) . '-' . substr( $raw, 6, 2 );
$params['facet_value'] = $date_fixed;
$params['facet_display_value'] = $date_fixed;
}
}
return $params;
}
add_filter( 'facetwp_index_row', 'fwp_index_acf_date', 10, 2 );