Skip to content

Instantly share code, notes, and snippets.

@MjHead
Last active November 3, 2021 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MjHead/493341a42b793ccc6cdb653ce932808a to your computer and use it in GitHub Desktop.
Save MjHead/493341a42b793ccc6cdb653ce932808a to your computer and use it in GitHub Desktop.
<?php
/**
* Given example can be used to format timestamp into human-readable date, but the same logic can be used for any modifications
*/
add_filter( 'jet-engine/admin-filters/filter-label', function( $label, $filter ) {
if ( 'meta' === $filter['type'] && '__date' === $filter['meta_key'] ) {
$label = date_i18n( get_option( 'date_format' ), $label );
}
return $label;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment