Skip to content

Instantly share code, notes, and snippets.

View slimndap's full-sized avatar

Jeroen Schmit slimndap

View GitHub Profile
@slimndap
slimndap / wp-theatre-add-doors-open-field.php
Created June 24, 2015 07:28
Adds a new 'Doors open' field to the event editor. For a more information see: http://www.slimndap.com/a-new-event-editor/.
/**
* Adds a 'Doors open' field to the event editor.
*
* Prepends the new field by filtering the current fields of the event editor
* using the 'wpt/event_editor/fields' hook.
*
* @param array $fields The current fields of the event editor.
* @param int $event_id The ID of the event being edited.
* @return array The new fields of the event editor.
*/
@slimndap
slimndap / wp-theatre-venue-city-filter.php
Last active August 29, 2015 14:23
Adds venue and city filters to event listings. Eg. [wpt_events venue="Ritz" city="El paso"]. For a full explanation see: http://www.slimndap.com/add-venue-and-city-filters-to-event-listings/.
/**
* Adds venue and city filters to the default options for event listings.
*
* @param array $defaults The current defaults.
* @return array The defaults with venue and city added.
*/
function add_venue_filter_to_events($defaults) {
$defaults['venue'] = false;
$defaults['city'] = false;
return $defaults;