Skip to content

Instantly share code, notes, and snippets.

@elimn
elimn / tribe_recurring_canonical_adjuster.php
Created March 17, 2016 07:18
MT | TEC | Swap the canonical URL for the /all/ page on recurring events
<?php
/*
* Swaps the canonical URL for the /all/ page on recurring events
*/
function tribe_recurring_canonical_adjuster() {
if ( ! tribe_is_recurring_event() ) return;
remove_action( 'wp_head', 'rel_canonical' );
add_action( 'wp_head', 'tribe_rel_canonical' );
@elimn
elimn / tribe_qr_scan_link.php
Created December 18, 2015 00:27
MT | ETP | Ties into the Zxing Barcode Scanner app for iOS and Android, allowing one-click scans
@elimn
elimn / functions.php
Created December 2, 2014 22:27
MT | TEC | Tribe Query Debug
<?php
// Checks the URL for the debug parameter
// example.com/event/event-name/?tribe_query_debug=true
function tribe_events_pre_get_posts_dumper ($query) {
$show_debug_info = isset($_GET['tribe_query_debug']) ? $_GET['tribe_query_debug'] : false;
if(($show_debug_info == "true" && $query->is_main_query() === true) || $show_debug_info == "full") {
echo "<h3>&lt;Tribe Events Query&gt;</h3>";
tribe_spit_it_out($query);
@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