Time field
Purpose
A time of day (opening hours, start time).
Field type name
time
Settings
| Setting | Description |
|---|---|
| Instructions | Shown to editors below the field label. (max 2000 characters) |
| Default Value | Time (HH:MM or HH:MM:SS) returned when nothing has been saved yet. (max 8 characters) |
| Return Format | PHP time format for cafe_get_field(), e.g. "H:i" or "g:i a". (max 50 characters) |
| Translation | How the field behaves in other languages: translate, copy, copy_once or do_not_translate. Used on top-level fields when WPML is active. See WPML. |
| Width | Width on edit screens, to place fields side by side: 100 (full), 75, 66, 50, 33 or 25 (%). Phones always show full width. |
| Label per language | The label and instructions per language code while editing in that language, e.g. {"nl": {"label": "Prijs"}}. Set on the Translation tab when WPML is active. See WPML. |
PHP return value
Formatted with Return Format (default H:i), e.g. g:i a → 9:30 am.
Example
echo esc_html( cafe_get_field( 'opens_at' ) ); // "09:30"