Skip to content

Instantly share code, notes, and snippets.

@vicskf
vicskf / functions.php
Created September 27, 2017 16:11
The Events Calendar > Month View > Shows the event for the first day and remove it from the rest in a multi-day event
<?php
/*
* Shows the event for the first day and remove it from the rest in a multi-day event.
* Limited to month view only
*
* Author: Barry Hughes
*/
function reduce_month_view_single_events( $events ) {
static $rendered_ids = array();
@vicskf
vicskf / functions.php
Created September 27, 2017 16:08
The Events Calendar > Allows visitors to page forward/backwards in any direction within month view an "infinite" number of times
<?php
/**
* Allows visitors to page forward/backwards in any direction within month view
* an "infinite" number of times (ie, outwith the populated range of months).
* Author: Barry Hughes
*/
if ( class_exists( 'Tribe__Events__Main' ) ) {
class ContinualMonthViewPagination {
public function __construct() {
@vicskf
vicskf / functions.php
Created September 21, 2017 15:48
TEC - Community Tickets > Change 'PayPal Split Payments' title for custom one
<?php
/**
* Community Tickets > Change 'PayPal Split Payments' title for custom one
*
* Author: Barry Hughes
*/
add_action( 'init', function() {
$gateways = WC_Payment_Gateways::instance()->get_available_payment_gateways();
if ( isset( $gateways['tribe-paypal-adaptive-payments'] ) ) {
@vicskf
vicskf / functions.php
Last active September 16, 2020 05:02
TEC - Filter Bar plugin > Always show open filters in mobile views
<?php
/**
* Filter Bar plugin
* Always show open filters in mobile views
* Author: Barry Hughes
*/
add_action( 'wp_footer', function() {
if (
! class_exists( 'Tribe__Events__Filterbar__View' )
@vicskf
vicskf / single-event.php
Created September 14, 2017 21:40
The Events Calendar > Template override for the single-events.php template to overcome Divi theme Incompatibility with comments
<?php
/**
* Single Event Template
* A single event. This displays the event title, description, meta, and
* optionally, the Google map for the event.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
*
* @package TribeEventsCalendar
* @version 4.3
@vicskf
vicskf / styles.css
Last active September 14, 2017 03:32
The Events Calendar PRO - Styles to improve UX of events in week view
/* Provides some space in week view for events that share same start date/time */
.tribe-events-grid .type-tribe_events {
transition: left 0.4s, right 0.4s;
}
.tribe-events-grid div.tribe-event-shared-start-time-1,
.tribe-events-grid div.tribe-event-shared-start-time-2 {
margin-top: -10px;
}
@vicskf
vicskf / functions.php
Created August 30, 2017 14:30
TEC: Move the export events link to before the calendar page
<?php
/**
* Move the export events link to before the calendar page
*/
function tribe_move_calendar_export_link() {
if ( function_exists( 'tribe' ) ) {
remove_action( 'tribe_events_after_footer', array( tribe( 'tec.iCal' ), 'maybe_add_link' ) );
add_action( 'tribe_events_before_header', array( tribe( 'tec.iCal' ), 'maybe_add_link' ), 11, 1 );
}
}
@vicskf
vicskf / rsvp.php
Created August 28, 2017 17:30
rsvp.php template override to workaround out of stock issue
<?php
/**
* This template renders the RSVP ticket form
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/tickets/rsvp.php
*
* @version 4.5.2
*
@vicskf
vicskf / functions.php
Created August 28, 2017 12:42
Link to event website in month view
<?php
// Set target '_blank' for tribe_get_event_website_link()
add_filter( 'tribe_get_event_website_link_target', function(){ return '_blank'; }, 10 );
// Set the event title as label for tribe_get_event_website_link()
add_filter( 'tribe_get_event_website_link_label', 'custom_event_website_link_label', 10 );
function custom_event_website_link_label() {
if ( ! tribe_is_month() ) {
@vicskf
vicskf / email.php
Created July 28, 2017 15:18
Ticket Email template override for Event Tickets to show End date
<?php
/**
* Tickets Email Template
* The template for the email with the purchased tickets when using ticketing plugins (Like WooTickets)
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/tickets/email.php
*
* This file is being included in events/lib/tickets/Tickets.php
* in the function generate_tickets_email_content. That function has a $tickets
* array with elements that have this fields: