Last active
December 10, 2020 23:30
-
-
Save janizde/2fd6b5162d97a7261512ce65913924c9 to your computer and use it in GitHub Desktop.
Change date range format in Overview Widget
This file contains hidden or 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
<?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