Skip to content

Instantly share code, notes, and snippets.

Jeroen Schmit slimndap

Block or report user

Report or block slimndap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@slimndap
slimndap / replace-venue-input-with-dropdown.php
Last active Jan 28, 2016
Replaces the venue input in the event editor with a dropdown. Place this code inside the functions.php of your theme.
View replace-venue-input-with-dropdown.php
<?php
/**
* Replaces the venue input in the event editor with a dropdown.
*
* @param string $html The default venue input HTML.
* @param mixed $field The venue field.
* @param int $event_id The ID of the event.
* @return string The vnue dropwdown HTML.
*/
function wpt_event_editor_get_venue_dropdown_html($html, $field, $event_id) {
@slimndap
slimndap / import-activetickets-longtext.php
Last active Mar 2, 2016
Imports the 'LongText' for a newly created production from ActiveTickets. For use with the ActiveTickets for WordPress plugin http://theater.slimndap.com/downloads/activetickets-for-wordpress/.
View import-activetickets-longtext.php
<?php
/**
* Imports the 'LongText' for a newly created production from ActiveTickets.
*
* By default, ActiveTicket for WordPress only imports the 'ShortText'.
* Importing the 'LongText' requires an extra API call for every production during the import,
* which may cause a higher load on the server.
*
* @param WPT_Production $production The production.
* @param object $activetickets_program The production data from ActiveTickets.
@slimndap
slimndap / wpt_add_long_excerpt.php
Created Oct 22, 2015
Increase the size of generated excerpts in the Theater for WordPress plugin to 50 characters.
View wpt_add_long_excerpt.php
<?php
/*
* Increase the size of generated excerpts to 50 characters.
* @param string $excerpt The current excerpt.
* @param WPT_Production $production The production.
* @return string The updated excerpt.
*/
function wpt_excerpt_long($excerpt, $production) {
$excerpt = $production->post()->post_excerpt;
if (empty($excerpt)) {
@slimndap
slimndap / wpt_add_director_label.php
Created Oct 18, 2015
Add a 'Director: ' label in front of a custom 'director' production field. For use inside the functions.php of your theme.
View wpt_add_director_label.php
<?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)) {
@slimndap
slimndap / wpt_customize_tickets_lightbox.php
Created Sep 2, 2015
Add this to the functions.php of your theme to set the dimensions of your popup to 1000 x 600 pixels and disable the popup for screens below a width of 480 pixels.
View wpt_customize_tickets_lightbox.php
<?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;
@slimndap
slimndap / wpt_change_events_on_production_page_header.php
Created Sep 2, 2015
Changes the default Events header on the production details page.
View wpt_change_events_on_production_page_header.php
<?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>';
}
@slimndap
slimndap / wpt_activetickets_subtitle_field.php
Last active Aug 29, 2015
An example of how to import custom fields (in this case a subtitle) during with the ActiveTickets import, using the Theater for Wordpress plugin. You can show the subtitle in your listings like this: `[wpt_events]{{title|permalink}}{{subtitle}}[/wpt_events].
View wpt_activetickets_subtitle_field.php
<?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();
@slimndap
slimndap / wpt_escape_from_iframe.js
Created Aug 12, 2015
Prevent your users from getting stuck inside the tickets iframe/lightbox when they return from the ActiveTickets screens.
View wpt_escape_from_iframe.js
/* escape from iframe, when returning from ActiveTickets */
if (window.self !== window.top) {
top.location.href = location.href;
}
@slimndap
slimndap / wpt_event_editor_add_venue_url.php
Last active Aug 29, 2015
Adds a link to the venue to the location HTML output. See http://theater.slimndap.com/link-the-event-location-to-the-venue-website/ for the full article.
View wpt_event_editor_add_venue_url.php
<?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) {
@slimndap
slimndap / wp-theatre-remove-enclogins-divs-from-date-and-time.php
Created Jul 28, 2015
Remove the enclosing divs from the HTML of the event startdate, starttime, enddate and endtime.
View wp-theatre-remove-enclogins-divs-from-date-and-time.php
<?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) {
You can’t perform that action at this time.