Class Theater_Event
Handles individual events.
An event can have one or more event dates.
Usage
// Output an event as HTML. $event = new Theater_Event( 123 ); echo $event;
// Output an event as HTML with a custom template: $event = new Theater_Event( 123, '{{title}}{{dates}}{{location}}' ); echo $event;
// Get the value of an event field: $event = new Theater_Event( 123 ); $dates = $event->dates(); // Eg. '05-06-2017'. $prices = $event->prices(); // An array of all ticket prices for this date. $title = $event->title(); // Eg. 'Sound of Music'.
// Output the value of an event date field as HTML: $event = new Theater_Event( 123 ); echo $event->dates; echo $event->prices; echo $event->title;
Fields
Events have the following fields:
field | description |
---|---|
categories |
The categories of the event. |
cities |
A summary of all the cities that the event takes place. |
content |
The post content of the event. |
dates |
A summary of all the dates of the event. |
excerpt |
The excerpt of the event. |
summary |
A summary of the event. |
permalink |
The permalink of the event. |
title |
The title of the event. |
thumbnail |
The thumbnail image of the event. |
HTML template
The default template for the HTML output of an event date is:
{{thumbnail|permalink}} {{title|permalink}} {{dates}} {{cities}}
- Theater_Item
-
Theater_Event
Methods summary
public
array
|
|
public
|
|
public
string
|
Methods inherited from Theater_Item
__construct()
,
apply_template_filters()
,
get_field()
,
get_field_html()
,
get_name()
,
get_post_type()
,
has_field()
Constants summary
string |
name
|
#
'event'
|
string |
post_type_name
|
#
'wp_theatre_prod'
|