Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change date range format in Overview Widget
<?php
add_filter('op_shortcode_markup', function ($markup, $shortcode) {
if ($shortcode instanceof \OpeningHours\Module\Shortcode\IsOpen) {
return preg_replace('/(\d{2}:\d{2}) - (\d{2}:\d{2})/', '$1–$2', $markup);
}
return $markup;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment