Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeroen Schmit slimndap

View GitHub Profile
@slimndap
slimndap / wpt_add_gutenberg_support.php
Created Sep 1, 2020
Adds Gutenberg support to events in the Theater for WordPress plugin. Add the snippet below to the functions.php of your (child) theme.
View wpt_add_gutenberg_support.php
<?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;
View wpt_cinemapaimpol.php
<?php
/*
Plugin Name: Cinema Paimpol - Theater for WordPress customizations
Version: 1.3
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 Sep 9, 2020
A custom WordPress plugin for Rebecca that import RTS shows into a custom post type.
View rebecca_import_films.php
<?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
*/
View calendar.php
<?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 Nov 13, 2019
Import extra fields from Z-Tickets object ( productions, shows ) to Theater object ( events, event dates ).
View ztickets_import_extra_fields.php
<?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 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 {
You can’t perform that action at this time.