{"id":390919,"date":"2026-10-25T13:07:22","date_gmt":"2026-10-25T13:07:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wxp-opening-times\/"},"modified":"2026-10-25T13:10:19","modified_gmt":"2026-10-25T13:10:19","slug":"wxp-opening-times","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/wxp-opening-times\/","author":5876200,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1.3","requires":"6.5","requires_php":"8.1","requires_plugins":null,"header_name":"WXP Opening Times","header_author":"Wilko van der Ploeg","header_description":"Show the opening times of an organisation and whether it is open right now.","assets_banners_color":"4f5669","last_updated":"2026-10-25 13:10:19","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/wpdigitalmarketing.nl\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":67,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"wvdploeg","date":"2026-10-25 13:10:19","revision":3764617}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3764623,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3764623,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3764623,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3764623,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":{"wxp\/opening-times":{"$schema":"https:\/\/schemas.wp.org\/trunk\/block.json","apiVersion":3,"name":"wxp\/opening-times","title":"Opening times","category":"wxp-plugins","icon":"clock","description":"Shows the opening times of a schedule and whether it is open right now.","keywords":["opening hours","hours","open","closed"],"textdomain":"wxp-opening-times","attributes":{"schedule":{"type":"string","default":""},"template":{"type":"string","default":"default"},"showStatus":{"type":"boolean","default":true},"showTitle":{"type":"boolean","default":false},"headingLevel":{"type":"number","default":3},"showDates":{"type":"boolean","default":false},"weekNav":{"type":"boolean","default":false},"weeksAhead":{"type":"number","default":4},"schema":{"type":"boolean","default":false},"textClosed":{"type":"string","default":""},"textOpen":{"type":"string","default":""},"textSeparator":{"type":"string","default":""},"textOpenUntil":{"type":"string","default":""},"textClosedOpens":{"type":"string","default":""}},"supports":{"html":false,"align":["wide","full"],"anchor":true,"customClassName":true},"editorScript":"file:.\/build\/index.js"}},"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3764623,"resolution":"1","location":"assets","locale":"","width":1225,"height":711},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3764623,"resolution":"2","location":"assets","locale":"","width":1220,"height":457}},"screenshots":{"1":"The weekly opening times, with a second set of times for a lunch break, and the alternative texts.","2":"Exceptions: a period with different times (such as winter hours) and a holiday rule, with a live preview."}},"plugin_section":[],"plugin_tags":[12431,13422,265747,15082,15060],"plugin_category":[],"plugin_contributors":[288446],"plugin_business_model":[],"class_list":["post-390919","plugin","type-plugin","status-publish","hentry","plugin_tags-business-hours","plugin_tags-holidays","plugin_tags-open-now","plugin_tags-opening-hours","plugin_tags-opening-times","plugin_contributors-wvdploeg","plugin_committers-wvdploeg"],"banners":{"banner":"https:\/\/ps.w.org\/wxp-opening-times\/assets\/banner-772x250.png?rev=3764623","banner_2x":"https:\/\/ps.w.org\/wxp-opening-times\/assets\/banner-1544x500.png?rev=3764623","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/wxp-opening-times\/assets\/icon-128x128.png?rev=3764623","icon_2x":"https:\/\/ps.w.org\/wxp-opening-times\/assets\/icon-256x256.png?rev=3764623","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/wxp-opening-times\/assets\/screenshot-1.png?rev=3764623","caption":"The weekly opening times, with a second set of times for a lunch break, and the alternative texts."},{"src":"https:\/\/ps.w.org\/wxp-opening-times\/assets\/screenshot-2.png?rev=3764623","caption":"Exceptions: a period with different times (such as winter hours) and a holiday rule, with a live preview."}],"raw_content":"<!--section=description-->\n<p>WXP Opening Times shows your opening times on any page with a shortcode, together with an Open\/Closed badge that stays correct while the visitor is on the page.<\/p>\n\n<ul>\n<li>Set the weekly opening times by ticking the days. Add a second (or third) set of times for a lunch break: 8:00\u201312:00 and 14:00\u201318:00. A closing time earlier than the opening time means \"after midnight\".<\/li>\n<li>Exceptions: different times in a period (summer and winter hours, a holiday closure, only on certain weekdays), and rules for holidays. Holiday dates are calculated for every year (Easter and everything that depends on it included).<\/li>\n<li>Several named schedules, for example \"Restaurant\" and \"Kitchen\". Each can use its own words, such as \"Absent\" instead of \"Closed\" for a doctor, or \"to\" instead of a dash.<\/li>\n<li>Visitors can browse to the next weeks.<\/li>\n<li>Templates are written in Twig and can be overridden in your theme.<\/li>\n<li>Works on its own. It can be used next to WXP Restaurant Menu, but does not need it.<\/li>\n<li>Ready for translation: help translate it on translate.wordpress.org.<\/li>\n<\/ul>\n\n<h4>Shortcode<\/h4>\n\n<pre><code>[wxp_opening_times]\n<\/code><\/pre>\n\n<p>Attributes:<\/p>\n\n<ul>\n<li><code>schedule<\/code> - id of the schedule, shown in the admin (default: the first schedule).<\/li>\n<li><code>template<\/code> - <code>default<\/code> (week table) or <code>compact<\/code> (one line), or a template from your theme.<\/li>\n<li><code>show_status<\/code> - <code>yes<\/code> or <code>no<\/code>: the Open\/Closed badge (default yes).<\/li>\n<li><code>show_title<\/code> - <code>yes<\/code> or <code>no<\/code>: the schedule name as a heading (default no); <code>heading_level<\/code> sets the level (2-6, default 3).<\/li>\n<li><code>show_dates<\/code> - <code>yes<\/code> or <code>no<\/code>: the date next to each weekday (default no).<\/li>\n<li><p><code>week_nav<\/code> - <code>yes<\/code> or <code>no<\/code>: previous\/next week buttons (default no); <code>weeks_ahead<\/code> sets how far visitors can look ahead (0-26, default 4).<\/p><\/li>\n<li><p><code>text_closed<\/code>, <code>text_open<\/code>, <code>text_separator<\/code>, <code>text_open_until<\/code>, <code>text_closed_opens<\/code> - other words for this block only, for example <code>text_closed=\"Absent\"<\/code>. They win over the texts set for the schedule in the admin. Use <code>{time}<\/code> in the last two for the time.<\/p><\/li>\n<\/ul>\n\n<h4>Elementor<\/h4>\n\n<p>With Elementor active, the \"Opening times\" widget (panel \"WXP Plugins\") shows the same output as the shortcode. It has the same options, optional alternative texts for that widget, and style controls for the badge colours, the typography, the lines, the highlight of today and the week buttons.<\/p>\n\n<h4>Block editor<\/h4>\n\n<p>The \"Opening times\" block (category \"WXP Plugins\") has the same options as the shortcode in the sidebar, including the alternative texts, and shows a live preview in the editor. Like the shortcode and the Elementor widget it is rendered on the server, so the status is always current.<\/p>\n\n<h4>Structured data (JSON-LD)<\/h4>\n\n<p>Add <code>schema=\"yes\"<\/code> to the shortcode (or switch on \"Structured data for search engines\" in the block or the Elementor widget) and the page also gets the opening times as schema.org JSON-LD (<code>openingHoursSpecification<\/code>), so search engines can show them. The weekly hours are included, and so are the exceptions of the next 365 days: a closed day has opens and closes \"00:00\". It is printed once per schedule on a page, and not in the editor previews. The business is a <code>LocalBusiness<\/code> with the site name and address of the home page; change the type or add details (address, phone number) with the <code>wxp_opening_times_schema<\/code> filter, for example to make it a <code>Restaurant<\/code>.<\/p>\n\n<p>If an SEO plugin already prints the data of your business, use <code>wxp_opening_times_get_schema()<\/code> to get the same array, and add it there.<\/p>\n\n<h4>For developers<\/h4>\n\n<p>Template override: copy a file from the plugin's <code>templates<\/code> folder to <code>wxp-opening-times\/<\/code> in your (child) theme. The markup contract is described at the top of <code>_base.html.twig<\/code>.<\/p>\n\n<p>Helper functions (call them after the <code>init<\/code> action):<\/p>\n\n<ul>\n<li><code>wxp_opening_times_is_open( $schedule = '', $at = null )<\/code> returns true when open. <code>$at<\/code> is an optional DateTimeImmutable.<\/li>\n<li><code>wxp_opening_times_get_holidays( $date )<\/code> returns the holidays on a date (<code>Y-m-d<\/code>) as a list of <code>key<\/code>, <code>label<\/code> and <code>calendar<\/code>.<\/li>\n<li><code>wxp_opening_times_get_schedules()<\/code> returns <code>configured<\/code> (whether anything was saved yet) and the <code>schedules<\/code> (<code>id<\/code> and <code>name<\/code>).<\/li>\n<li><code>wxp_opening_times_get_status( $schedule = '', $at = null )<\/code> returns <code>open<\/code>, <code>closes_at<\/code>, <code>opens_at<\/code>, <code>next_change<\/code> (Unix times) and <code>schedule<\/code>, or null for an unknown schedule.<\/li>\n<\/ul>\n\n<p>Filters: <code>wxp_opening_times_status<\/code>, <code>wxp_opening_times_template_context<\/code>, <code>wxp_opening_times_template_paths<\/code>, <code>wxp_opening_times_twig_cache<\/code>, <code>wxp_opening_times_schema<\/code>, <code>wxp_opening_times_schema_days<\/code>, <code>wxp_opening_times_load_css<\/code> (return false to load your own CSS) and <code>wxp_opening_times_holidays<\/code> (add holiday providers, for example for other calendars).<\/p>\n\n<p>CSS custom properties on <code>.wxp-opening-times<\/code> (<code>--wxp-ot-open-bg<\/code>, <code>--wxp-ot-closed-bg<\/code> and more) change the colours.<\/p>\n\n<h3>Source code and third-party libraries<\/h3>\n\n<p>The admin app and the block are built with <code>@wordpress\/scripts<\/code>. The readable sources are in the plugin, in <code>assets\/admin\/src<\/code> and <code>assets\/block\/src<\/code>; the build commands are in <code>package.json<\/code> (<code>npm install<\/code>, then <code>npm run build<\/code>).<\/p>\n\n<p>The plugin bundles <a href=\"https:\/\/twig.symfony.com\/\">Twig<\/a> (BSD 3-Clause) and a few Symfony polyfills (MIT) in <code>vendor-prefixed<\/code>, with their namespaces prefixed so they cannot clash with other plugins. They are installed with Composer (<code>composer install<\/code>).<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to <code>\/wp-content\/plugins\/<\/code> and activate it.<\/li>\n<li>Open \"Opening times\" in the admin menu and set your times.<\/li>\n<li>Add <code>[wxp_opening_times]<\/code> to a page.<\/li>\n<\/ol>\n\n<p>The time zone, the week start day and the time format are taken from Settings, General.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"why%20does%20%22open%20now%22%20use%20the%20site%27s%20time%20zone%3F\"><h3>Why does \"open now\" use the site's time zone?<\/h3><\/dt>\n<dd><p>Opening times belong to a place, not to the visitor. Set the right time zone under Settings, General.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20a%20page%20cache%3F\"><h3>Does it work with a page cache?<\/h3><\/dt>\n<dd><p>Yes. The status is refreshed in the browser when the page was cached for more than five minutes, and at the moment the status changes.<\/p><\/dd>\n<dt id=\"which%20holidays%20are%20included%3F\"><h3>Which holidays are included?<\/h3><\/dt>\n<dd><p>Secular and Christian holidays, with the Christian ones calculated from Easter. Islamic and Jewish holidays come with the add-on WXP Opening Times: Jewish and Islamic holidays.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First stable release. No functional changes since 0.12.0.<\/li>\n<li>The source of the built JavaScript is now included in the plugin.<\/li>\n<\/ul>\n\n<h4>0.12.0<\/h4>\n\n<ul>\n<li>New helper functions <code>wxp_opening_times_get_holidays( $date )<\/code> (the holidays on a date) and <code>wxp_opening_times_get_schedules()<\/code>, used by WXP Local Events to warn about events on holidays and closed days.<\/li>\n<\/ul>\n\n<h4>0.11.0<\/h4>\n\n<ul>\n<li>A holiday can now have more than one date in a year (needed for the Islamic calendar), for add-ons.<\/li>\n<li>A holiday rule for a holiday that is not available (for example when an add-on is deactivated) is kept, shown as \"not available\" in the admin, and does nothing until the add-on is back.<\/li>\n<\/ul>\n\n<h4>0.10.0<\/h4>\n\n<ul>\n<li>Opening times as schema.org JSON-LD (<code>schema=\"yes\"<\/code>, block toggle, Elementor switch), with the filters <code>wxp_opening_times_schema<\/code> and <code>wxp_opening_times_schema_days<\/code> and the function <code>wxp_opening_times_get_schema()<\/code>.<\/li>\n<\/ul>\n\n<h4>0.9.0<\/h4>\n\n<ul>\n<li>Block for the block editor, with a live preview and the same options as the shortcode.<\/li>\n<li>Elementor widgets of all WXP plugins now share one panel, \"WXP Plugins\".<\/li>\n<li>The compact template no longer repeats the status in a second line.<\/li>\n<\/ul>\n\n<h4>0.8.0<\/h4>\n\n<ul>\n<li>Elementor widget with content, text and style controls.<\/li>\n<li>Alternative texts per block through the <code>text_*<\/code> shortcode attributes.<\/li>\n<li>The plugin shows an admin notice instead of a fatal error when it cannot start; the bundled Twig no longer conflicts with other plugins that bundle it.<\/li>\n<\/ul>\n\n<h4>0.7.0<\/h4>\n\n<ul>\n<li>Alternative texts per schedule: the words Open and Closed, the separator between opening and closing time, and the two status sentences.<\/li>\n<li>A rule that is switched from Closed to Open gets a first set of opening times.<\/li>\n<\/ul>\n\n<h4>0.6.0<\/h4>\n\n<ul>\n<li>Dutch, German and French translations, helper functions for themes, readme.<\/li>\n<\/ul>\n\n<h4>0.5.0<\/h4>\n\n<ul>\n<li>Week navigation for visitors and a status that updates by itself.<\/li>\n<\/ul>\n\n<h4>0.4.0<\/h4>\n\n<ul>\n<li>The <code>[wxp_opening_times]<\/code> shortcode with Twig templates.<\/li>\n<\/ul>\n\n<h4>0.3.0<\/h4>\n\n<ul>\n<li>The admin screen.<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>Storage and REST routes.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Opening times logic and holiday calculation.<\/li>\n<\/ul>","raw_excerpt":"Show the opening times of an organisation, and whether it is open right now.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/390919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=390919"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/wvdploeg"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=390919"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=390919"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=390919"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=390919"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=390919"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=390919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}