Skip to content

Instantly share code, notes, and snippets.

@elimn
elimn / tribe_alter_event_archive_titles.php
Created August 24, 2015 15:00
MT | TEC | Alter event archive page titles, like Month View
<?php
/*
* Alters event's archive titles
*/
function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) {
// Modify the titles here
// Some of these include %1$s and %2$s, these will be replaced with relevant dates
$title_upcoming = 'Upcoming Events'; // List View: Upcoming events
@elimn
elimn / tribe_related_posts_args_limiter.php
Last active September 22, 2015 19:25
MT | TEC | Limits Related Posts to events within 2 months of event date
@elimn
elimn / tribe_theme_template_chooser.php
Last active September 22, 2015 14:05
MT | TEC | Set a custom page template for specific pages
<?php
/*
* Set a custom page template for specific pages within The Events Calendar
*/
function tribe_theme_template_chooser ( $template ) {
if ( ! tribe_is_event() ) return $template;
/*
@elimn
elimn / tribe_link_to_fb_event.php
Created October 8, 2015 20:39
MT | TEC | Add a link to the Facebook event page
@elimn
elimn / tribe_event_website_truncator.php
Created November 13, 2015 22:37
MT | TEC | Truncate lengthy Event Website URL Labels
<?php
/*
* Truncates (trims) the Event Website URL label when its too lengthy
*/
function tribe_event_website_truncator ( $label ) {
// Change this to adjust when the truncator starts trimming characters
$max_length = 25;
if( strlen($label) > $max_length ) {
@elimn
elimn / tribe_remove_endtime.php
Last active June 20, 2018 18:10 — forked from theeventscalendar/Hide end time
MT | TEC | Remove end times from every page except single (requires theme override)
<?php
/*
* Hide end time in list, map, photo, and single event view
* NOTE: This will only hide the end time for events that end on the same day
*/
function tribe_remove_end_time_single( $formatting_details ) {
$formatting_details['show_end_time'] = 0;
return $formatting_details;
@elimn
elimn / move-edd-tickets-form.php
Last active December 1, 2015 14:35 — forked from theeventscalendar/move-edd-tickets-form.txt
MT | TEC | Move EDD Tickets Form above Event content
<?php
/*
* Move EDD Tickets Form above Event content
*/
if ( class_exists('Tribe__Tickets_Plus__Commerce__EDD__Main') ) {
remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance(), 'front_end_tickets_form'), 5 );
add_action( 'tribe_events_single_event_before_the_content', array( Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance(), 'front_end_tickets_form') );
}
@elimn
elimn / tribe_wootix_no_hijack.php
Last active June 12, 2017 14:59 — forked from theeventscalendar/WooCommerce-product-page.php
MT | TEC | Allows customers to access the WooCommerce product page for tickets
<?php
/*
* Causes WooCommerce Ticket product pages to stop redirecting to their event page
* See https://theeventscalendar.com/knowledgebase/selling-tickets-from-the-woocommerce-products-page/
*/
function tribe_wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
@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_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