WST Block Timer

描述

WST Block Timer adds a single container block. Put any blocks inside it and set a start and/or end date and time; the contents appear on the front end only during that period. Before the start and after the end, the block outputs nothing.

Use it for time-limited announcements, seasonal banners, campaign notices, or any content that should appear and disappear on a schedule without you editing the page again.

Key features

  • One container block (“Block Timer”) that holds any inner blocks
  • Set a start, an end, or both — leave a side empty to leave it open-ended
  • For regular visitors, out-of-range content is left off the page
  • Optional preview: signed-in staff can see out-of-range content in a dashed box, to check it before it goes live
  • Choose who sees that preview: Administrators only, Editors and above, or Authors and above
  • Times are evaluated in your site’s timezone
  • While a preview is active, that page’s full-page cache is disabled so out-of-range content is not served to regular visitors
  • If WST Date Simulator (by the same author) is also active, both plugins use the same simulated time as “now”, so a scheduled display period can be previewed together with scheduled posts

About permissions

  • Viewing the preview and changing the plugin’s settings use separate permission checks
  • Changing the settings always requires an Administrator (manage_options)
  • Who can view the preview is configurable on the settings screen (Editors and above, by default)

Good to know

  • This is a presentational schedule, not access control. Hidden content still exists in the post and may be reachable through revisions, feeds, or the REST API. Do not use it to protect secret information.
  • Crossing the start or end time does not change a cached page until it is regenerated. Shorten your cache lifetime or exclude the affected pages if exact switch timing matters.
  • Deactivating the plugin stops the schedule. Content saved by this plugin is stored in a form that is usually not shown by the browser, but this is not a security measure.

螢幕截圖

Blocks

This plugin provides 1 block.

  • Block Timer A container block shown only between a start and end date/time, hidden automatically outside that window.

安裝

  1. Upload the plugin files to /wp-content/plugins/wst-block-timer, or install the plugin through the “Plugins > Add New” screen in WordPress.
  2. Activate the plugin through the “Plugins” screen.
  3. In the editor, add the “Block Timer” block, place your content inside it, and set the start/end in the block sidebar.
  4. (Optional) Go to the “Block Timer” menu in wp-admin to turn on the preview of out-of-range content and choose who can see it.

常見問題

What happens outside the window?

For regular visitors the block outputs nothing. When the preview option is enabled, only signed-in users with the preview permission see the content, in a dashed box labeled with the display period.

Can I set only an end date?

Yes. Leave the start empty and the content is visible until the end. Leave the end empty and it is visible from the start onward. Leave both empty and it is always visible.

What if the start is after the end?

The editor shows an error on the block. On the front end, regular visitors see nothing; users with the preview permission see it flagged as an invalid setting.

Which timezone is used?

Your site’s timezone, from Settings > General.

Does it change the actual content or post status?

No. Nothing in the database is changed. While out of range, the inner blocks are simply left off the front end.

Does it work with full-page caching?

Yes. But a cached page stays frozen at whatever it showed when it was cached, until the cache is refreshed: a block can fail to appear after its start time, or fail to disappear after its end time. For pages where the switch time matters, shorten the cache lifetime or exclude them from caching. Pages being previewed by a permitted signed-in user are excluded automatically.

評價

There are no reviews for this plugin.

貢獻者及開發者

“WST Block Timer” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

WST Block Timer 外掛目前已有 1 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 WST Block Timer 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

修改日誌

1.0.0

  • Initial release