Skip to content

Instantly share code, notes, and snippets.

@MjHead
Last active January 6, 2025 15:13
Show Gist options
  • Save MjHead/8d01239d699a7103f3cd10967349830e to your computer and use it in GitHub Desktop.
Save MjHead/8d01239d699a7103f3cd10967349830e to your computer and use it in GitHub Desktop.
<?php
add_filter( 'jet-smart-filters/query/final-query', function( $query ) {
// replace this with values you need
$meta_key = 'after';
$date_format = 'Y-m-d\TH:i:s';
if ( ! empty( $query['meta_query'] ) ) {
foreach( $query['meta_query'] as $index => $row ) {
if ( $meta_key === $row['key'] ) {
$row['value'] = wp_date( $date_format, $row['value'][0] );
$query['meta_query'][ $index ] = $row;
}
}
}
return $query;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment