Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / use-us-state-abbreviations.php
Last active Jan 20, 2021
TEC > Use abbreviations in US state names
View use-us-state-abbreviations.php
<?php
/* Description: In the US state dropdown the abbreviations will be used instead of the full state name.
* Usage: Paste the below snippet into your active (child) theme's functions.php file
*
* Plugin: The Events Calendar
* Author: Andras Guseo
* Last updated: 2021-01-20
*/
add_filter( 'tribe_us_states', 'tec_states_abbrev_only' );
@andrasguseo
andrasguseo / add-purchase-time.php
Created Jan 20, 2021
ET: Add purchase time on the Attendees admin page in Event Tickets
View add-purchase-time.php
<?php
/* Description: Add purchase time on the Attendees admin page in Event Tickets
* Usage: Paste the below snippet into your active (child) theme's functions.php file
*
* Plugin: Event Tickets
* Author: Andras Guseo
* Last updated: 2021-01-20
*/
// Adding an extra column header for Purchase time
@andrasguseo
andrasguseo / additional-ticket-email-content.php
Last active Jan 8, 2021
Adding content to ticket emails
View additional-ticket-email-content.php
<?php
/* Adds conttent to the top of the email */
add_action( 'tribe_tickets_ticket_email_top', 'my_email_top_content' );
function my_email_top_content() {
echo "My custom content";
}
/* Adds conttent at the top of each ticket */
@andrasguseo
andrasguseo / exclude_content_from_event_search.php
Created Dec 21, 2020
TEC: Excludes the event description and excerpt fields from the search
View exclude_content_from_event_search.php
<?php
/* Description: Excludes the event description and excerpt fields from the search.
* Usage: Paste the below snippet into your active (child) theme's functions.php file
*
* Plugin: The Events Calendar
* Author: Barry Hughes, Andras Guseo
* Last updated: 2020-12-21
*/
function modify_event_searches( $search, WP_Query $wp_query ) {
if ( empty( $search ) ) return;
@andrasguseo
andrasguseo / ical-strip-shortcodes.php
Created Nov 4, 2020
The Events Calendar : Strip shortcodes from the post content in the iCal export.
View ical-strip-shortcodes.php
<?php
/**
* Description: This snippet will try to strip the shortcodes from the post content
* in the iCal export feed.
*
* Usage: Copy the snippet into your child theme's functions.php file.
*
* Plugins: The Events Calendar
* Author: Andras Guseo
* Last updated: November 4, 2020
@andrasguseo
andrasguseo / ical-content-to-excerpt.php
Created Nov 4, 2020
The Events Calendar : Change the post content to the excerpt in the iCal export.
View ical-content-to-excerpt.php
<?php
/**
* Description: This snippet will change the post conetent to the post excerpt
* in the iCal export feed.
* Note, if the excerpt is empty, it will also be empty in the export.
*
* Usage: Copy the snippet into your child theme's functions.php file.
*
* Plugins: The Events Calendar
* Author: Andras Guseo
@andrasguseo
andrasguseo / button-style.css
Created Dec 13, 2019
Temporarily fixing plus/minus button font size for Event Tickets Plus 4.11
View button-style.css
.tribe-tickets__item__quantity__remove,
.tribe-tickets__item__quantity__add {
font-size: 24px;
}
@andrasguseo
andrasguseo / single-event.php
Created Oct 4, 2019
TEC - Template override for list view to include organizers
View single-event.php
<?php
/**
* List View Single Event
* This file contains one event in the list view
*
* This override will add the organizer(s) after the event information
*
* Place this template file in your own theme / child theme by creating a file at:
* [your-theme]/tribe-events/list/single-event.php
*
@andrasguseo
andrasguseo / event-organizer.php
Last active Oct 4, 2019
TEC - Template override for the event organizer block to include hotlinks for email phone and organizer name.
View event-organizer.php
<?php
/**
* Block: Event Organizer
*
* This override will add clickable URLs to the following:
* - Event organizer name
* - Event organizer phone number
* - Event organizer email address
*
* Place this template file in your own theme / child theme by creating a file at:
@andrasguseo
andrasguseo / dequeue-tribe-events-styles-scripts.php
Created Jun 26, 2019 — forked from samkent/dequeue-tribe-events-styles-scripts.php
Dequeue Tribe Events (The Events Calendar) scripts and styles if not calendar or event page
View dequeue-tribe-events-styles-scripts.php
<?php
/**
* Detect Tribe Events page
* @link https://wordpress.stackexchange.com/questions/340515/writing-a-function-to-detect-an-event
*/
function is_tribe_calendar() {
if (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular( 'tribe_events' )) {
return true;
}
else {