Skip to content

Instantly share code, notes, and snippets.

View slimndap's full-sized avatar

Jeroen Schmit slimndap

View GitHub Profile
@slimndap
slimndap / jeero-event-date-check.php
Last active January 4, 2023 22:57
A Jeero extension plugin that prevents Jeero from importing events from the Stager ticketing system to The Events Calendar, if an event has a publication date in the future. The plugin is written by ChatGPT!
<?php
/*
Plugin Name: Jeero Event Date Check
Description: Prevents Jeero from importing events with a future publication date.
Version: 1.0
Author: Your Name
*/
function jeero_stop_future_events( $result, $data, $raw, $theater, $subscription ) {
// Check if $result is already a WP_Error object
@slimndap
slimndap / stager.js
Last active June 4, 2022 20:58
Stager Advanced Ticketshop Integration
"use strict";
/*
* Enables the 'Advanced Integration' of the Stager Ticketshop.
*
* This script makes is possible to embed the Stager Ticketshop in an iframe with support for:
* * dynamic iframe height based on the content of the iframe content
* * cross domain GTM Tracking
*
* For more information about the advanced integration of the Stager Ticketshop see:
@slimndap
slimndap / wpt_add_gutenberg_support.php
Created September 1, 2020 11:54
Adds Gutenberg support to events in the Theater for WordPress plugin. Add the snippet below to the functions.php of your (child) theme.
<?php
/**
* Adds Gutenberg support to events in the Theater for WordPress plugin.
*
* @param array $post_type_args The current settings for the events post type (wp_theatre_prod).
* @return array The new settings for the events post type.
*/
function wpt_add_gutenberg_support( $post_type_args ) {
$post_type_args[ 'show_in_rest' ] = true;
return $post_type_args;
<?php
/*
Plugin Name: Jeero ❤️ Cinema Paimpol
Version: 1.4
Description: Custom functionality for use with the Theater for WordPress plugin
Author: Jeroen Schmit
Author URI: https://slimndap.com
Plugin URI: https://gist.github.com/slimndap/53a2572b1ea7b5a932b9d9221572444f
*/
@slimndap
slimndap / rebecca_import_films.php
Last active September 9, 2020 14:36
A custom WordPress plugin for Rebecca that import RTS shows into a custom post type.
<?php
/*
Plugin Name: Rebecca RTS Film Import
Version: 1.1
Description: A custom WordPress plugin for Rebecca that imports RTS shows into a custom post type.
Author: Jeroen Schmit
Author URI: https://slimndap.com
Plugin URI: https://gist.github.com/slimndap/e813d03998119e7775025f0a8c004953
*/
<?php
namespace Tahoearthauscinema\Theater\Calendar;
// Change days header.
function change_days_header( $html ) {
global $wp_locale;
$start_of_week = get_option( 'start_of_week' );
@slimndap
slimndap / ztickets_import_extra_fields.php
Created November 13, 2019 13:09
Import extra fields from Z-Tickets object ( productions, shows ) to Theater object ( events, event dates ).
<?php
/**
* Imports extra fields from Z-Tickets object ( productions, shows ) to Theater object ( events, event dates ).
*
* @param WPT_Production|WPT_Event $theater_object
* @param object $ztickets_object
* @return void
*/
function ztickets_import_extra_fields( $theater_object, $ztickets_object ) {
@slimndap
slimndap / tev_update_event.php
Last active September 23, 2021 20:28
Syncs Veezi events with The Event Calendar. For use in conjunction with the Veezi for WordPress plugin.
<?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 December 29, 2017 10:41
Changes the datetime format used for the datetime picker inside the event editor.
<?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 December 29, 2017 10:23
Changes the header for today and tomorrow in lists that are grouped by day.
<?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 ) {