Create Events

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

Top ↑

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'

Top ↑

cost

  • Type:int or float
  • Description: The event cost, should be a numeric value. 0 = free. Only used if no ticketing plugin is active

Top ↑

currency_position

  • Type: string
  • Description: Where the currency symbol is in relation to the cost
  • Options: 'prefix' or 'postfix'

Top ↑

currency_symbol

  • Type: string
  • Description: The currency symbol for the cost of the event

Top ↑

duration

  • Type: int
  • Description: Duration of the event specified in seconds

Top ↑

end_date

  • Type: DateTime
  • Description: The end date and time of the event. Requires start date and must be a date/time after the start date
  • Format: 'YYYY-MM-DD HH:MM:SS'

Top ↑

image

  • Type: string
  • Description: The event featured image ID or URL

Top ↑

organizer

  • Type: int
  • Description: The organizer ID

Top ↑

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'

Top ↑

timezone

  • Type: string
  • Description: The timezone location where the event will take place
  • Format: 'Country/City'

Top ↑

url

  • Type: string
  • Description: The external event website URL to be shown in the event details section

Top ↑

venue

  • Type: int
  • Description: The venue ID

Top ↑

Event Presentation Data

Top ↑

  • 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'

Top ↑

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'

Top ↑

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'

Top ↑

  • Type: tribe_is_truthy()
  • Description: Whether the event should show the map link or not
  • True Strings: '1','enable','enabled','on','y','yes','true'

Top ↑

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'

Top ↑

Recurrence

Top ↑

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 _EventRecurrence post meta, if preferred

Top ↑

series

  • Type: int
  • Description: The Series ID to add the event to