| 开发者 |
mobalio
alexmobal |
|---|---|
| 更新时间 | 2026年8月28日 20:47 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
openingHoursSpecification structured data.[mobal_opening_hours] renders with your saved defaults. Every display option can be overridden per instance, e.g.:
[mobal_opening_hours variant="compact" has_open_status="1" open_color="#2e7d32" closed_color="#c62828" font_size="14px" alignment="center"]
With a connected Mobal account, show a specific profile (location) per instance:
[mobal_opening_hours profile_id="00000000-0000-0000-0000-000000000000"]
Tip: the settings page's live preview builds this shortcode for you. Pick a profile and press "Copy shortcode".
[mobal_opening_hours] shortcode wherever you want the hours to appear.Yes, fully. Hours are stored in your WordPress database and nothing is ever sent to Mobal unless you explicitly connect a profile.
The block editor and Elementor natively. Divi, WPBakery, Beaver Builder, Bricks and others work via the shortcode: add a Code/Text/Shortcode element and paste [mobal_opening_hours].
In the visitor's local time zone (their device clock). Visitors of a local business are usually in the same time zone as the business, so the status matches in practice. If many of your visitors are far away, leave the status indicator off. It is off by default.
The widget script must not be concatenated with other scripts. The plugin marks it with data-no-optimize, data-cfasync="false" and nowprocket. If your optimizer ignores those, exclude businessHoursWidget.js from JS combining in its settings.
With a connected Mobal account, yes. Add each profile in Opening Hours → Connect to Mobal: paste its ID or profile-page URL, and the plugin looks the profile up and shows its name for confirmation. The first profile in the list is the default. New blocks and the plain shortcode use it. Every block and Elementor widget offers a profile dropdown with the profile names (managed in Mobal), and the shortcode takes profile_id="...". Standalone mode stores one set of hours for the site. Multiple locations come from connected Mobal profiles, because that is where the per-location hours are stored.
Everything needed to rebuild the compiled files ships inside the package. The plugin's JavaScript sources are in src/, with the build configuration in package.json and webpack.config.js (rebuild with npm install && npm run build). The bundled hours widget ships unminified, and its TypeScript/Vue sources and build configuration are in assets/widget/src/ (rebuild with npm ci && npm run build:wp). Each has a developer readme. Linter configuration and unit tests are development-only and are not included. The widget bundle contains a dormant fetch path (axios) used only when the widget is embedded outside WordPress. This plugin never uses it: WordPress inlines the hours data server-side, so visitors' browsers make no requests to Mobal.