Skip to content

Instantly share code, notes, and snippets.

@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
@andrasguseo
andrasguseo / install-composer
Created April 16, 2024 21:15 — forked from nem-c/install-composer
Composer for DevKinsta
## On you machine run:
docker exec -it devkinsta_fpm bash
## After you are logged change to /tmp
cd /tmp
## Install and configure composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
@andrasguseo
andrasguseo / preserve-links.php
Created March 20, 2024 13:54
EA > Preserve / reconvert links in Microsoft Teams invitations when imported from Outlook (updated)
@andrasguseo
andrasguseo / event-status-csv-import.php
Last active March 12, 2024 13:12
TEC > Add support for Event Status to CSV import
<?php
/**
* Add support for Event Status to CSV import
*
* Usage:
* - Add the snippet to your functions.php file or with a plugin like Code Snippets.
*
* @author Andras Guseo
*
* Plugins required: The Events Calendar
@andrasguseo
andrasguseo / ticket-limits.php
Created March 8, 2024 11:55
ET > Set ticket limits based on event post ID.
<?php
/**
* Set ticket limits based on event post ID.
*
* Usage:
* - Add the snippet to your functions.php file or with a plugin like Code Snippets.
*
* @author Andras Guseo
*
* Plugins required: Event Tickets
@andrasguseo
andrasguseo / custom-ticket-additional-fields.php
Last active March 20, 2024 13:30
ET > Custom additional fields for RSVPs and tickets, and adding them to the email - for the new ticket emails
<?php
/**
* Add additional fields for Tickets (extension needed!) and add that information to the
* ticket email.
*
* Requirements:
* - Event Tickets
* - New ticket emails - https://theeventscalendar.com/knowledgebase/event-tickets-emails/
* - Event Tickets Additional Fields extension - https://theeventscalendar.com/extensions/additional-fields-for-tickets/
* - Sample code included below. Customize based on your needs.
@andrasguseo
andrasguseo / recurrence-end-date.php
Created March 5, 2024 11:39
ECP > Set recurring event end date
<?php
/**
* Change the end date for recurring events from 1 year in the future to something else.
* IMPORTANT: Works with Classic Editor only!
*
* Usage: Add the snippet to your functions.php file or with a plugin like Code Snippets.
*
* @author Andras Guseo
*
* Plugins required: Events Calendar Pro
@andrasguseo
andrasguseo / location-search-autocomplete.php
Created March 5, 2024 10:55
ECP > Autocomplete for location search
<?php
/**
* Autocomplete for location search. Work in progress.
* Requirements:
* - Custom Google Maps API key (https://theeventscalendar.com/knowledgebase/setting-up-your-google-maps-api-key/)
* - Enable the Places API in Google Cloud Console (https://console.cloud.google.com/apis/dashboard)
* - Setting up API key restrictions is recommended! (https://theeventscalendar.com/knowledgebase/using-google-maps-api-key-restrictions/)
* - The Places API restriction should be added to the JavaScript map displays restrictions.
*
* IMPORTANT: Using the Google Maps API and the Places API can incur costs!!!
@andrasguseo
andrasguseo / tickets.php
Created February 8, 2024 10:57
ET > Template override for the tickets block - Hide tickets block when logged in user already has a ticket.
<?php
/**
* Block: Tickets
*
* This template override will hide the tickets block, if the logged in user
* has already purchased a ticket for the given event.
* For it to work the following setting has to be enabled:
* Tickets > Settings > General > Require users to log in before they purchase tickets
*
* This is a template ovverride for the following file:
@andrasguseo
andrasguseo / limit-ticket-quantity.php
Last active March 12, 2024 10:29
ET > Limit ticket quantity counter to 1
<?php
/**
* Limit ticket quantity counter to 1.
*
* Usage: Add the snippet to your functions.php file or with a plugin like Code Snippets.
*
* @author: Andras Guseo
*
* Plugins required: Event Tickets
* Created: February 7, 2024