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 / tev_update_event.php
Last active Jul 18, 2019
Syncs Veezi events with The Event Calendar. For use in conjunction with the Veezi for WordPress plugin.
View tev_update_event.php
<?php
function tev_get_venue_id() {
$venue_id = wp_cache_get( 'venue_id', 'tev' );
if ( false === $venue_id ) {
$venue_post = get_page_by_title( 'The Luna Theater', OBJECT, 'tribe_venue' );
if ( !( $venue_post ) ) {
@slimndap
slimndap / change_event_editor_datetime_format.php
Created Dec 29, 2017
Changes the datetime format used for the datetime picker inside the event editor.
View change_event_editor_datetime_format.php
<?php
/**
* Changes the datetime format used for the datetime picker inside the event editor.
*
* @param array $defaults The current defaults.
*/
function change_event_editor_datetime_format( $defaults ) {
$defaults[ 'datetime_format' ] = 'Y-m-d h:i A';
@slimndap
slimndap / change_grouped_by_day_header.php
Last active Dec 29, 2017
Changes the header for today and tomorrow in lists that are grouped by day.
View change_grouped_by_day_header.php
<?php
/**
* Changes the header for today and tomorrow in lists that are grouped by day.
*
* @param string $header The header.
* @param string $day The day.
* @param array $args The arguments for the HTML of this list.
*/
function change_grouped_by_day_header( $header, $day, $args ) {
@slimndap
slimndap / unhide_old_tickets_url.php
Created Oct 17, 2017
Unhides the tickets button for past events.
View unhide_old_tickets_url.php
/**
* Unhides the tickets button for past events.
*
* @param string $html
* @param WPT_Event $event
* @return string
*/
function unhide_old_tickets_url( $html, $event ) {
ob_start();
@slimndap
slimndap / red_ticket_buttons.css
Last active Oct 17, 2017
Make the ticket links from the Theater for Wordpress plugin look like red buttons.
View red_ticket_buttons.css
.wp_theatre_event_tickets_url {
background-color: #d9534f;
color: #fff;
border: 1px solid #b52b27 !important;
text-decoration: none;
display: inline-block;
padding: 12px 20px;
border-radius: 2px;
}
.wp_theatre_event_tickets_url:hover {
@slimndap
slimndap / set_default_month.php
Last active Jun 15, 2017
Sets the default month for the events page to the first month that has event dates.
View set_default_month.php
<?php
/**
* Sets the default month for the events page to the first month.
*
* @return void
*/
public function set_default_month() {
global $wp_query;
global $wp_theatre;
if (
@slimndap
slimndap / theregal_import_PreShowStartTime.php
Last active Jun 2, 2017
Changes the event date of Veezi films from 'FeatureStartTime' to 'PreShowStartTime'. For use with the Veezi for WordPress plugin (https://wp.theater/downloads/veezi-wordpress/).
View theregal_import_PreShowStartTime.php
<?php
/**
* Changes the event date of Veezi films from 'FeatureStartTime' to 'PreShowStartTime'.
*
* @param array $event_args The current event arguments.
* @param object $veezi_event The event from the Veezi feed.
* @param int $production_id The ID of the parent production.
* @return array The updated event arguments.
*/
function theregal_import_PreShowStartTime( $event_args, $veezi_event, $production_id ) {
@slimndap
slimndap / add_class_to_tickets_buttons.php
Created Mar 4, 2017
How to add an extra CSS class to tickets buttons, using the Theater for WordPress plugin.
View add_class_to_tickets_buttons.php
<?php
/**
* Adds an 'art-button' CSS class to the tickets buttons of events.
*
* @param array $classes The current CSS classes of tickets buttons.
* @param WPT_Event $event The event that the button belongs to.
* @return array The new CSS classes.
*/
function add_class_to_tickets_buttons( $classes, $event ) {
@slimndap
slimndap / get_current_event_html.php
Last active Feb 19, 2017
Adds a [current_event] shortcode that displays the event that is currently on.
View get_current_event_html.php
<?php
/**
* Get the HTML to display the current event.
*
* @param array $args The shortcode arguments.
* @param string $template The shortcode template.
* @return string
*/
function get_current_event_html( $args, $template = false ) {
global $wp_theatre;
@slimndap
slimndap / wpt_structured_data_set_location_name.php
Last active Feb 6, 2016
Filter the venue name inside structured event data and always set it to the name of your theater. Place the code inside the functions.php of your theme. For use with the Rich Snippets for Theater plugin (http://theater.slimndap.com/downloads/rich-snippets-theater/).
View wpt_structured_data_set_location_name.php
<?php
/**
* Sets the venue to a fixed value inside structured event data.
*
* @param string $name The original venue value.
* @param WPT_Event $event The event.
* @return string The new venue value.
*/
function wpt_structured_data_set_location_name($name, $event) {
You can’t perform that action at this time.