Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / attendee-fields.php
Created September 10, 2024 18:52
ETP > Template overrides for the PDF file generation
<?php
/**
* PDF Pass: Body - Ticket Info - Attendee Fields
*
* Place this template in your own theme by creating a file at:
* wp-content/themes/[your-theme]/tribe/tickets-plus/integrations/event-tickets-wallet-plus/pdf/pass/body/ticket-info/attendee-fields.php
*
* See more documentation about our views templating system.
*
* @link https://evnt.is/event-tickets-wallet-plus-tpl Help article for Wallet Plus template files.
@andrasguseo
andrasguseo / calendar-events.php
Created July 25, 2024 10:54
TEC > Template overrides for the month view to include all events in the "Month view events per day" setting.
<?php
/**
* View: Month View - Calendar Events
*
* This is an override for the following template:
* wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day/calendar-events.php
*
* Override this template in your own theme by creating a file at:
* wp-content/themes/[your-theme]/tribe/events/v2/month/calendar-body/day/calendar-events.php
*
@andrasguseo
andrasguseo / event-uid-to-ical-feed.php
Last active August 12, 2024 17:24
TEC > Generate a UID for the event and add it to the iCal feed.
<?php
/**
* Description: Generate a UID for the event and add it to the iCal feed.
* Usage: Paste the below snippet into your active (child) theme's functions.php file
* or use a plugin like Code Snippets.
*
* Plugins: The Events Calendar
* Author: Andras Guseo
* Last updated: 2024-07-22
*/
@andrasguseo
andrasguseo / functions.php
Created June 28, 2024 22:42
TEC > Show event search results in list view
<?php
add_filter( 'tribe_events_views_v2_rest_params', 'tec_redirect_search_to_list_view', 10, 2 );
function tec_redirect_search_to_list_view( $params, $request ) {
$ref = $_SERVER['HTTP_REFERER'];
// Are you coming from the list view?
$coming_from_list = str_contains( $ref, '/list/' );
if (
@andrasguseo
andrasguseo / functions.php
Last active June 28, 2024 21:35
TEC > Adding the event status column to the events admin and making it sortable
<?php
/**
* Description: Adds the event status column to the events admin and makes it sortable.
* Usage: Paste the below snippet into your active (child) theme's functions.php file
* or use a plugin like Code Snippets.
*
* Plugins: The Events Calendar
* Author: Andras Guseo, Masood Ahmed Khan, Guga Alvez
* Last updated: 2024-06-28
*/
@andrasguseo
andrasguseo / tec-ebr-inject-iframe.php
Last active August 29, 2024 20:37
TEC Eventbrite Tickets > Inject iFrame to content
<?
/**
* Description: Inject the Eventbrite Tickets iFrame into the post content.
* Workaround for Elementor Pro.
* Usage: Paste the below snippet into your active (child) theme's functions.php file
* or use a plugin like Code Snippets.
* Important: For the ticket iframe to show the event either needs to be publicly listed, or
* the iframe needs to be forced with this snippet:
* add_filter( 'tribe_events_eventbrite_iframe_display', '__return_true' );
*
@andrasguseo
andrasguseo / filterbar-sort-filter-options.php
Created May 24, 2024 20:48
Filter Bar > Sort filter options
<?php
function tec_custom_filter_values_order( $values, $field ) {
// Bail if it's not the right field
if ( $field !== '_ecp_custom_2' ) {
return $values;
}
$order = ["New", "Beginner", "Experienced"];
usort( $values, function( $a, $b ) use ( $order ) {
@andrasguseo
andrasguseo / functions.php
Created April 26, 2024 09:31
ET+ > Exclude QR code from selected tickets
<?php
/**
* Description: Exclude QR codes from selected tickets.
* Usage: Paste the below snippet into your active (child) theme's functions.php file
* or use a plugin like Code Snippets.
*
* Plugin: Event Tickets, Event Tickets Plus
* Author: Andras Guseo
* Last updated: 2024-03-25
*/
@andrasguseo
andrasguseo / attendee-info-column.php
Last active April 26, 2024 17:43
ET+ > Show the collected attendee information on the Attendees page in a column
<?php
/**
* Description: Add a column with attendee information to the Attendees admin page in Event Tickets
* Usage: Paste the below snippet into your active (child) theme's functions.php file
* or use a plugin like Code Snippets.
*
* Plugin: Event Tickets, Event Tickets Plus
* Author: Andras Guseo
* Last updated: 2024-04-26
*/
@andrasguseo
andrasguseo / etp-default-commerce-provider.php
Created April 19, 2024 19:52
ET+ > Set default commerce provider
<?php
/**
* Set the default commerce provider for events
*
* Usage: Add the snippet to your functions.php file or with a plugin like Code Snippets
*
* @author: Andras Guseo
*
* Plugins required: Event Tickets Plus
* Created: April 10, 2024