Class Theater_Event_Date
Handles individual event dates.
Each event can have one or more event dates.
Usage
// Output an event date as HTML. $date = new Theater_Event_Date( 123 ); echo $date;
// Output an event date as HTML with a custom template: $date = new Theater_Event_Date( 123, '{{title}}{{startdate}}{{city}}{{tickets}}' ); echo $date;
// Get the value of an event date field: $date = new Theater_Event_Date( 123 ); $startdate = $date->startdate(); // Eg. '05-06-2017'. $prices = $date->prices(); // An array of all ticket prices for this date. $title = $date->title(); // Eg. 'Sound of Music'.
// Output the value of an event date field as HTML: $date = new Theater_Event_Date( 123 ); echo $date->startdate; echo $date->prices; echo $date->title;
Fields
Event dates have the following fields:
field | description |
---|---|
duration |
The duration, based on the starttime and endtime. |
enddate |
The end date |
endtime |
The end time |
enddatetime |
The timestamp of the end |
location |
The location, based on the venue and the city. |
prices |
The different prices. |
startdate |
The start date |
starttime |
The start time |
startdatetime |
The timestamp of the start |
tickets |
The tickets link. |
venue |
The venue. |
city |
The city. |
Additionally, the following fields are inherited from the parent event:
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}} {{remark}} {{startdatetime}} {{location}} {{tickets}}
- Theater_Item
-
Theater_Event_Date
Methods summary
public
array
|
|
public
WPT_Production|boolean
|
|
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
|
#
'date'
|
string |
post_type_name
|
#
'wp_theatre_event'
|
string |
tickets_status_onsale
|
#
'_onsale'
|
string |
tickets_status_cancelled
|
#
'_cancelled'
|
string |
tickets_status_soldout
|
#
'_soldout'
|
string |
tickets_status_other
|
#
'_other'
|