Skip to content

Instantly share code, notes, and snippets.

@barryhughes
barryhughes / custom-all-recurring-events-slug.php
Last active August 4, 2017 06:32
Recurring event: modifies /all/ URLs to use a custom slug in place of 'all' (written for ECP 4.2.6)
<?php
/**
* Takes care of modifying the "all" keyword used in the all-recurring-events
* view to something else.
*/
class Events_Custom_All_Link {
protected $keyword = '';
public function __construct( $keyword = 'each' ) {
$this->keyword = sanitize_key( $keyword );
@GeoffEW
GeoffEW / prevent_email.php
Created September 29, 2016 03:47
tribe__prevent_woo_tickets_email_to_be_sent
<?php
/* Tribe, prevent woo tickets email to be sent */
add_filter( 'wootickets-tickets-email-enabled', '__return_false' );
@andrasguseo
andrasguseo / add_venue_to_photo_view.php
Last active May 19, 2017 22:37
The Events Calendar Pro - Adds City below event date in photo view for Sarah
<?php
/* Adds City below event date in photo view
* Paste it in your child theme's functions.php file
*/
function add_venue_to_photo_view() {
/* If we have city, then show city */
if ( tribe_get_city() ) {
$venue = tribe_get_city();
}
echo $venue;
@cliffordp
cliffordp / functions.php
Last active July 16, 2021 00:06
Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
<?php
/**
* Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
*
* By Matt B and Cliff P
*
* From https://gist.github.com/cliffordp/66bf05df61ee269c60ff20d6f39e2cab
*/
function cliff_etplus_woo_cart_quantity_readonly() {
@cliffordp
cliffordp / functions.php
Last active July 13, 2017 05:21
The Events Calendar: Tribe [tribe_venues_map] shortcode
<?php
/**
* The Events Calendar: [tribe_venues_map] shortcode
* Preview: https://cl.ly/3Z1e000U3L0U
*
* By Nico and Cliff 2016-08-05
* From https://gist.github.com/cliffordp/8ecb7022d92f9c989e2e72ecdcf25c60
*/
function tribe_venues_map_logic ( $atts ){
<?php
/**
* Event Submission Form Ticket Block
* Renders the ticket settings in the submission form.
*
* Override this template in your own theme by creating a file at
* [your-theme]/tribe-events/community-tickets/modules/tickets.php
*
* @version 4.1
* @package Tribe__Events__Community__Tickets__Main
@cliffordp
cliffordp / functions.php
Last active December 15, 2017 07:36
Do not load https://optimizerwp.com/optimizer-pro/ theme's Google Maps script on The Events Calendar (TEC) pages, except for Post Tags, then do not load TEC's
<?php
/**
* Do not load https://optimizerwp.com/optimizer-pro/ theme's Google Maps script on The Events Calendar (TEC) pages, except for Post Tags, then do not load TEC's
*
* From https://gist.github.com/cliffordp/ca3baf77c9be8b72f37db10c7c91783b
*
* For https://theeventscalendar.com/support/forums/topic/errors-you-have-included-the-google-maps-api-multiple-times-on-this-page/
*/
function tec_1163154_dequeue_gmaps_script() {
<?php
/* Tribe, force event, venue & organizer websites to open in a new window */
add_filter( 'tribe_get_event_website_link_target', function () { return '_blank'; } );
add_filter( 'tribe_get_venue_website_link_target', function () { return '_blank'; } );
add_filter( 'tribe_get_organizer_website_link_target', function () { return '_blank'; } );
@geoffgraham
geoffgraham / reverse-alphabet-order.php
Last active December 19, 2016 21:11
The Events Calendar 4.2.6 // Display Upcoming Events in Descending Alphabetical Order
add_action( 'pre_get_posts', 'tribe_post_alphabetical_ordering', 51 );
function tribe_post_alphabetical_ordering( $query ) {
if( tribe_is_upcoming() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
@cliffordp
cliffordp / functions.php
Last active May 18, 2022 04:12
BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
<?php
/**
* BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* From https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182
*
* Reference: https://developer.wordpress.org/reference/functions/wp_mail/#using-headers-to-set-from-cc-and-bcc-parameters
*
*/
function cliff_et_rsvp_bcc_admin_ticket() {