Theater for WordPress Code Reference
  • Package
  • Class

Packages

  • Theater
    • Abstracts
    • Events

Classes

  • Theater_Event
  • Theater_Event_Date
  • Theater_Event_Date_Link
  • Theater_Event_Date_List
  • Theater_Event_Field
  • Theater_Event_List

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
Extended by Theater_Event_Date
Package: Theater\Events
Since: 0.16
Located at functions/event/class-theater-event-date.php

Methods summary

public array
# get_fields( )

Gets a list of of available fields for this item.

Gets a list of of available fields for this item.

Returns

array

Since

0.16
public WPT_Production|boolean
# get_event( )

Gets the event that this date belongs to.

Gets the event that this date belongs to.

Returns

WPT_Production|boolean
The event or if no event is set.

Since

0.4

0.15 Removed local caching of event production. Return if no production is set.


Uses

WPT_Production::post_type_name
public string
# get_html( )

Gets the HTML for an event date.

Gets the HTML for an event date.

Returns

string
The HTML for an event date.

Since

0.4
0.10.8 Added a filter to the default template.
0.14.7 Added the $args parameter.
0.15.2 Removed the $args parameter.

Uses

Theater_Item::get_post_type()
to get the post type for an event date.
WPT_Event_Template::get_merged() to get the merged HTML for an event date.

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_hidden
# '_hidden'
string tickets_status_cancelled
# '_cancelled'
string tickets_status_soldout
# '_soldout'
string tickets_status_other
# '_other'

Properties summary

Properties inherited from Theater_Item

$ID

Theater for WordPress Code Reference API documentation generated by ApiGen