Skip to content

Instantly share code, notes, and snippets.

View slimndap's full-sized avatar

Jeroen Schmit slimndap

View GitHub Profile
@slimndap
slimndap / red_ticket_buttons.css
Last active October 17, 2017 19:23
Make the ticket links from the Theater for Wordpress plugin look like red buttons.
.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 / unhide_old_tickets_url.php
Created October 17, 2017 19:27
Unhides the tickets button for past events.
/**
* 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 / 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 ) {
@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 / 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 / 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 ) {
<?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 / 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
/*
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 / 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;