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_custom_theme_text.php
Last active September 17, 2015 18:23
MT | TEC | Change the wording of any bit of text in WordPress
<?php
/*
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
* See the codex to learn more about WP text domains:
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology
* Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
*/
function tribe_custom_theme_text ( $translations, $text, $domain ) {
@elimn
elimn / functions.php
Last active September 18, 2015 21:21
MT | TEC | Prepend category name(s) to event title
<?php
// Prepends category name(s) to the event titles
function tribe_events_title_include_cat ($title, $id) {
$separator = ' &raquo; '; // HTML Separator between categories and title
$cats = get_the_terms($id, 'tribe_events_cat');
$is_ajax = defined('DOING_AJAX') && DOING_AJAX;
$is_truly_admin = is_admin() && !$is_ajax;
@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_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_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_link_to_fb_event.php
Created October 8, 2015 20:39
MT | TEC | Add a link to the Facebook event page
@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_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 / FrontendAttendeeData.php
Created January 5, 2016 19:06
MT | ETP | List attendees on the single events page
<?php
/**
* List attendees on the single events page (WooCommerce-based orders
* in this example).
*
* This is just a quick hack/possible starting point - be nice to add a
* helper/template tag within Event Tickets to get the attendee list or
* change the public visibility of Tribe__Tickets__Tickets::get_attendees()
* to make it easier for folks to roll their own.