Create Events
Topics
This documentation provides a list of acceptable arguments for programmatically creating The Events Calendar events using the ORM API.
The minimum arguments required are the title, and when the event will occur – this can be start_date and either end_date or duration, or just all_day if true.
If one of these requirements is missing, false will be returned from tribe_events()->set_args( $args )->create(); and a new event will not be created.
If everything goes well, a new event will be created and the command returns the new post object.
For more context (specific to events), check out our examples of each argument and use cases.
Event Meta Fields
all_day
- Type:
tribe_is_truthy() - Description: Whether the event lasts the whole day or not
- True Strings:
'1','enable','enabled','on','y','yes','true'- These strings can be adjusted using the
tribe_is_truthy_stringsfilter
- These strings can be adjusted using the
currency_position
- Type:
string - Description: Where the currency symbol is in relation to the cost
- Options:
'prefix'or'postfix'
start_date
- Type:
DateTime - Description: The start date and time of the event. Requires end date or duration
- Format:
'YYYY-MM-DD HH:MM:SS'
Event Presentation Data
featured
- Type:
tribe_is_truthy() - Description: Whether the event should be featured on the site or not
- True Strings:
'1','enable','enabled','on','y','yes','true'- These strings can be adjusted using the
tribe_is_truthy_stringsfilter
- These strings can be adjusted using the
hide_from_upcoming
- Type:
tribe_is_truthy() - Description: Whether the event should be hidden in the calendar view or not
- True Strings:
'1','enable','enabled','on','y','yes','true'- These strings can be adjusted using the
tribe_is_truthy_stringsfilter
- These strings can be adjusted using the
show_map
- Type:
tribe_is_truthy() - Description: Whether the event should show a map or not
- True Strings:
'1','enable','enabled','on','y','yes','true'- These strings can be adjusted using the
tribe_is_truthy_stringsfilter
- These strings can be adjusted using the
show_map_link
- Type:
tribe_is_truthy() - Description: Whether the event should show the map link or not
- True Strings:
'1','enable','enabled','on','y','yes','true'- These strings can be adjusted using the
tribe_is_truthy_stringsfilter
- These strings can be adjusted using the
sticky
- Type:
tribe_is_truthy() - Description: Whether the event should be sticky in the calendar view or not
- True Strings:
'1','enable','enabled','on','y','yes','true'- These strings can be adjusted using the
tribe_is_truthy_stringsfilter
- These strings can be adjusted using the
Recurrence
recurrence
- Type:
string - Description: Recurrence rule if the event repeats
- Format: iCalendar RRULE format. Compatibility with the iCalendar standard is one of the new features of the CT1 implementation and it can be used to replace the verbose recurrence format used in the
_EventRecurrencepost meta, if preferred