Skip to main content

[bec_dates]

Outputs a simple readable date range built from bec_checkin and bec_checkout in the URL.


Where to put it

Page headers, sticky summaries, confirmation banners—anywhere you already carry search parameters forward.


Attributes

AttributeDefaultMeaning
date_format(empty)PHP date_i18n() format string. When set, overrides preset.
presetlongBuilt-in format: iso, short, medium, long, or full (locale-aware month/day names).
label_stylefrom_toRange template: arrow (%1$s → %2$s), from_to, or from_to_lower. Ignored when label is set.
label(empty)Custom sprintf pattern with %1$s = check-in, %2$s = check-out (overrides label_style).

Site-wide defaults can be set with the bec_date_format_defaults filter (context bec_dates).

Developers can still replace the entire output with bec_shortcode_dates_format (non-empty return skips attribute formatting).

Other filters: bec_shortcode_dates_text, bec_shortcode_dates_html, bec_format_date, bec_format_date_range.


Examples

Default (long format with “from … to …” wording):

[bec_dates]

ISO dates with arrow separator:

[bec_dates preset="iso" label_style="arrow"]

Custom PHP date format:

[bec_dates date_format="j M Y" label="%1$s – %2$s"]

Visitor output

When search context is incomplete the shortcode prints nothing.

Otherwise visitors typically see a paragraph like:

Monday, 1 June 2026 to Monday, 8 June 2026

(with defaults preset="long" and label_style="from_to")

or, with preset="iso" and label_style="arrow":

2026-06-01 → 2026-06-08

(Locale formatting follows WordPress settings and the chosen preset / date_format.)

bec_dates front-end


CSS hooks

  • bec-shortcode-dates

Tips

Use [bec_booking_summary] instead when you need dates plus guests and pricing—the summary includes richer readouts.