-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Custom additional fields for RSVPs and tickets, and adding them to the email – for the new ticket emails
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. Template override, see additional file Usage: Add the snippet to your functions.php file or with a…
-
-
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!!!
-
Hide tickets block when logged in user already has a ticket – template override
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…
-
-
-
Set a target for the event title
The code only adds a custom field for events where you can select the link target. A template override for each calendar view is needed where you want this implemented!!!
-
-
-
Open the Filter Bar on mobile on initial pageload
By default, Filter Bar is closed on mobile regardless of the setting. With this snippet Filter Bar will show on page load when using the horizontal setup.
-
Remove the Event URL when it’s the same as the source URL
When importing from OtherURL and the EventURL field is empty, it will be filled with the URL of the source site by default. This snippet makes sure it stays empty.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Using a template for event imports
This “hack” works for imports from Google Calendar and feeds that correspond to the iCalendar standard (iCal feeds and ICS files). To make this work, create a draft event with no data. Create only the block structure. Once saved, grab the post ID. Enter that post ID in the first line of the function, where:…
-
Flip the order of the RSVP and Ticket boxes on the front-end
When using the Classic Editor to create Tickets and RSVPs, then the RSVPs always show up first on the page, followed by the tickets. This CSS snippet will change that order.
-
-
-
Add the “Event Slug” column to CSV import.
This can be used as a base to add any kind of data / meta data to the CSV import.
-
-
Show the full stock next to the available stock, for example “9 of 10 available”
This is for the tickets block. It will not work with RSVPs. Screenshot:
-
-
-
-
-
-
-
-
Remove the event post URL from the event iCal export feed
You can modify the following fields: DTSTART DTEND DTSTAMP CREATED LAST-MODIFIED UID SUMMARY DESCRIPTION URL LOCATION CATEGORIES ATTACH ORGANIZER Refer to: the-events-calendar/src/Tribe/iCal.php:620
-
-
-
-
-
-
Validating CSS values with regex in PHP
Experimental! /** * Regex validation of CSS values for the options. * * @param $subject * * @return bool */ private function css_value_validation( $subject ) { $pattern = ‘(([0-9]{1,})(\.{0,1})([0-9]{0,})(px|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax|%{0,1})(\s{0,1})){1,4}’; if ( preg_match( $pattern, $subject ) ) { return true; } return false; }
-
Using Google Maps API Key Restrictions
You will need this script if you would like to have API Key restrictions for your Google Maps API Key. Use one Google Maps API Key for JavaScript Map displays (The Events Calendar). Your “Maps JavaScript API” key should select “HTTP referrers (web sites)” restriction. Use a different API Key for venue geolocation lookups (Events…
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Smart month search
Improve month view search so it is not restricted to the current month. Experimental! Use at own risk, there are known bugs/quirks with this code. If a search is conducted in month view but the relevant events are in a different month, switch to that month.
-
-
-
-
-
-
-
-
-
-
-
Custom events query
A template to create a custom events query for The Events Calendar
-
-
-
Change Google Map attributes
A sample snippet showing how to change Google Map attributes.
