This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Adds a 'Director: ' label in front of a custom 'director' production field. | |
* @param string $value The value for the 'director' field. | |
* @param string $field The custom field name. | |
* @param WPT_Production $production The production. | |
* @return string The updated value for the 'director' field. | |
*/ | |
function wpt_add_director_label($value, $field, $production) { | |
if (!empty($value)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sets the dimensions of the tickets lightbox to 1000 x 600 pixels and | |
* disables the lightbox for screens below a width of 480 pixels. | |
* | |
* @param array $args The default settings for the tickets lightbox. | |
* @return array The new settings. | |
*/ | |
function wpt_customize_tickets_lightbox($args) { | |
$args['width'] = 1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Changes the default Events header on the production details page. | |
* | |
* @param string $header The default Events header. | |
* @return string The new Events header. | |
*/ | |
function wpt_change_events_on_production_page_header($header) { | |
return '<h4>Showtimes</h4>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds the subtitle ActiveTickets field to a production on import. | |
* | |
* You can show the subtitle in your listings like this: | |
* [wpt_events]{{title|permalink}}{{subtitle}}[/wpt_events] | |
* | |
* You can add the subtitle to your template like this: | |
* $production = new WPT_Production(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* escape from iframe, when returning from ActiveTickets */ | |
if (window.self !== window.top) { | |
top.location.href = location.href; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds a new 'Venue URL' field to the event editor. | |
* | |
* @param array $fields The current fields of the event editor. | |
* @return array The new fields of the event editor. | |
*/ | |
function wpt_event_editor_add_venue_url_field($fields) { | |
$new_fields = array(); | |
foreach($fields as $field) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes the enclosing div from the event startdate HTML. | |
* | |
* @param string $html The HTML. | |
* @param array $filters The template filters. | |
* @param WPT_Event $event The event. | |
* @return string The HTML without enclosing divs. | |
*/ | |
function wpt_remove_startdate_divs($html, $filters, $event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wpt_listing .wp_theatre_event .theater-012-demo { | |
position: relative; | |
margin: 0; | |
} | |
.wpt_listing .wp_theatre_event .theater-012-demo .event-info { | |
bottom: 0; | |
background-color: rgba(0, 0, 0, 0.2); | |
color: #fff; | |
width: 100%; | |
padding: 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Show dates and prices for the events of this production. | |
*/ | |
if ( is_singular( 'wp_theatre_prod' ) ) { | |
$production = new WPT_Production(); | |
echo '<ul>'; | |
foreach ( $production->events() as $event ) { | |
echo '<li>'.$event->startdate_html().$event->prices_html().'</li>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes 'End time' and all tickets fields from the event editor. | |
* | |
* @param array $fields The current fields of the event editor. | |
* @param int $event_id The event being edited. | |
* @return array The new fields of the event editor. | |
*/ | |
function remove_event_editor_fields($fields, $event_id) { | |
$new_fields = array(); |