Skip to content

Instantly share code, notes, and snippets.

@elimn
elimn / tribe_add_gcal_to_email.php
Created April 24, 2017 16:04
MT | ET | Add a + Google Calendar link to each ticket in the tickets email
<?php
/**
* Adds a + Google Calendar link to each ticket in the tickets email
*/
function tribe_add_gcal_to_email( $event ) {
printf(
'<a class="tribe-events-gcal tribe-events-button" href="%1$s" title="%2$s">%3$s</a>',
Tribe__Events__Main::instance()->esc_gcal_url( tribe_get_gcal_link( $event ) ),
esc_attr__( 'Add to Google Calendar', 'the-events-calendar' ),
@elimn
elimn / Tribe__Events__Filterbar__Filters__Category_Custom.php
Created June 21, 2016 05:59
MT | TEC | Customized version of the Category Filter that includes CSS classes for subcategories
<?php
/**
* Customized version of the Category Filter that includes CSS classes for subcategories
* New filter available in WP-Admin > Events > Settings > Filters
*/
if ( class_exists( 'Tribe__Events__Filterbar__Filters__Category' ) ) {
class Tribe__Events__Filterbar__Filters__Category_Custom extends Tribe__Events__Filterbar__Filters__Category {
@elimn
elimn / tribe_event_tickets_rsvp_success_script.php
Created June 2, 2016 16:57
MT | ETP | When an RSVP is submitted succesfully redirect users to a new page
<?php
/*
* When an RSVP is submitted succesfully redirect users to a new page
*/
function tribe_event_tickets_rsvp_success_script() {
if( ! isset($_GET['rsvp_sent']) || $_GET['rsvp_sent'] != 1 ) return;
// Change this to URL that you want users redirected to
@elimn
elimn / tribe_set_default_date.php
Last active April 19, 2022 13:26
MT | TEC | Set the default date for views like List and Month
<?php
/*
* Set the default date for views like List and Month
* Modify the $date variable below to set your date
*/
function tribe_set_default_date( $wp_query ) {
// Only run on main event queries
if ( ! tribe_is_event_query() || ! $wp_query->is_main_query() || $wp_query->get( 'eventDate' ) != '') return;
@elimn
elimn / tribe_neuter_qr.php
Last active December 22, 2021 11:43
MT | TEC | Hide QR codes from the Email/Tickets sent to purchasers
<?php
/*
* Hides QR codes from the Email/Tickets sent to purchasers
*/
function tribe_neuter_qr () {
if ( class_exists( 'Tribe__Tickets_Plus__Main' ) ) {
$qr_class = Tribe__Tickets_Plus__Main::instance()->qr();
remove_action( 'tribe_tickets_ticket_email_ticket_bottom', array( $qr_class, 'inject_qr' ) );
}
@elimn
elimn / tribe_remove_time_list_view.php
Created August 2, 2016 03:49
MT | TEC | Remove event time from showing in List View
<?php
/**
* Removes time from List View
*/
function tribe_remove_time_list_view( $settings ) {
if( ! tribe_is_upcoming() && ! tribe_is_past() ) return $settings;
$settings[ 'time' ] = false;
@elimn
elimn / tribe_set_link_website.php
Last active December 23, 2020 20:21
MT | TEC | Change event, venue, or organizer links to the relevant website URL
@elimn
elimn / tribe_remove_single_calendar_links.php
Created February 14, 2017 07:39
MT | TEC | Remove the iCal and Google cal links from the single event page
@elimn
elimn / tribe_strip_date_format_slashes.php
Last active February 23, 2020 22:42
MT | TEC | Escape characters in Events Calendar date format
<?php
/*
* This allows you to escape characters in TEC date formats
*
* Example date format: F \d\e j, Y
* Example date: dezembro de 31, 2014
* http://codex.wordpress.org/Formatting_Date_and_Time#Escaping
*
* You can change these formats in WP Admin > Events > Settings > Display
*/
@elimn
elimn / functions.php
Last active December 2, 2019 18:38
MT | TEC | Change past event views to reverse chronological order
<?php
// Changes past event views to reverse chronological order
function tribe_past_reverse_chronological ($post_object) {
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false;
if(tribe_is_past() || $past_ajax) {
$post_object = array_reverse($post_object);
}