Skip to content
Sign in
Display During Conditional Shortcode icon

Display During Conditional Shortcode

Show or hide content based on date ranges, recurring day/time schedules, or custom strtotime expressions.

Not scanned yet WordPress plugin 200 installs

Install in

No install steps yet

Follow the steps on the source page.

Display content conditionally based on a schedule. Choose from three scheduling modes:

  1. Date Range – Show content between specific start and end dates
  2. Recurring – Show content on specific days of the week during a time window
  3. Custom – Use PHP strtotime expressions for flexible scheduling

Gutenberg Block

The Display During block provides a visual editor with:

  • Sidebar controls for all three scheduling modes
  • Date/time pickers for start and end dates
  • Day-of-week checkboxes for recurring schedules
  • Live status indicator (active/inactive)
  • Optional fallback message when content is hidden
  • Copy as Shortcode toolbar button

Shortcodes

The [display_during] shortcode works in the Classic Editor and anywhere shortcodes are supported.

Date range:
[display_during start_day_time=”June 1, 2026 8:00 am” end_day_time=”December 31, 2026 11:59 pm”]Content here[/display_during]

Recurring schedule (new in 2.0):
[display_during days=”mon,wed,fri” start_time=”09:00″ end_time=”17:00″]Office hours content[/display_during]

Custom strtotime:
[display_during start_day_time=”Sun 8:00 am” end_day_time=”Mon 8:00 pm”]Weekend content[/display_during]

With fallback message:
[display_during end_day_time=”June 1, 2026″]Register now![display_during_message]Registration has closed.[/display_during_message][/display_during]

Shortcode Parameters

  • start_day_time – When to start showing content (strtotime string or date)
  • end_day_time – When to stop showing content
  • days – Comma-separated days for recurring mode (mon,tue,wed,thu,fri,sat,sun)
  • start_time – Start time for recurring mode (HH:MM format)
  • end_time – End time for recurring mode (HH:MM format)
  • timezone_location – PHP timezone identifier (defaults to site timezone)
  • message – Plain text fallback message (legacy; use nested shortcode for rich content)

Written by Joobi from the project's own listing. See the source page

blockconditionaldisplayscheduleshortcode
25 Nov 2026
Version 2.0.1 released. Not scanned yet.

2.0.1

  • Fix: Content inside [display_during] and [display_during_message] is returned as written again. Version 2.0 filtered it a second time on output, which removed tags such as <style> but left their CSS showing as page text, and removed form fields and iframes produced by nested shortcodes. Enclosed content now relies on WordPress’s save-time filtering, like any post content. The message attribute is still filtered on output.
  • Compatibility: Tested up to WordPress 7.1.

2.0

  • New: Gutenberg block with visual schedule controls (Dates, Recurring, Custom modes)
  • New: Recurring schedule mode – show content on specific days of the week during a time window
  • New: Nested [display_during_message] shortcode for rich fallback content (HTML, shortcodes, media)
  • New: Shortcode-to-block transform for converting existing shortcodes
  • New: Copy as Shortcode toolbar button in block editor
  • New: Live schedule status indicator in editor (active/inactive/unknown)
  • New: Shared schedule evaluation engine used by both block and shortcode
  • New: Full i18n support with .pot file for translations
  • Improvement: Refactored shortcode handler to use shared evaluator
  • Improvement: All date comparisons use integer timestamps (fixes microsecond comparison bug)
  • Requires WordPress 6.1+ (for block editor support)

1.4

  • Feature: Support start_day_time without end_day_time to show content permanently after a date
  • end_day_time is no longer required when start_day_time is provided

1.3

  • Security: Sanitize all shortcode attributes with sanitize_text_field() and wp_kses_post()
  • Security: Validate timezone against timezone_identifiers_list() before use
  • Improvement: Rewrite date handling using DateTime/DateTimeZone objects instead of date_default_timezone_set()
  • Improvement: Add try/catch for invalid date/time strings in shortcode attributes
  • Coding standards: Full PHPCS WordPress-Extra compliance

1.2

  • Bug fix to reset timezone back to whatever it was before the shortcode runs

1.1

  • Public release of plugin to WordPress repository

1.0

  • Initial version of plugin, internal release only
8 Mar 2013Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)