Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / ical-export-events-custom.php
Last active May 15, 2018
TEC - iCal export of this year's events
View ical-export-events-custom.php
<?php
/**
* Description: This snippet will enable you to have an iCal export of all this year's events
* when using this url:
* http://example.com/events/?ical=1&tribe_display=custom
*
* Formats you can use:
* Simple: exports events of this year, i.e. Jan 1st to Dec 31 of current year
* http://example.com/events/?ical=1&tribe_display=custom
*
@cliffordp
cliffordp / functions.php
Last active Oct 27, 2017
The Events Calendar PRO: Make tribe_is_week() return TRUE even for tribe_events shortcode.
View functions.php
<?php
/**
* The Events Calendar PRO: Make tribe_is_week() return TRUE even for
* tribe_events shortcode.
*
* @link https://gist.github.com/cliffordp/7b48b2e6a0562709cf9d069f38cfdcee
* @link https://gist.github.com/GeoffEW/dff981933c950aebc3045b827eddc101 or something like it could be used alongside this snippet.
* @link https://central.tri.be/issues/91891
*/
@cliffordp
cliffordp / functions.php
Last active Aug 23, 2018
The Events Calendar: Redirect all site searches to be Tribe Bar Keyword searches.
View functions.php
<?php
/**
* The Events Calendar: Redirect all site searches to be Tribe Bar Keyword searches.
*
* Should only be used if you want only Event posts to appear in general search
* queries. Again, Posts, Pages, and custom post types allowed to appear in
* search results will no longer be included--ONLY Events will appear.
* Example redirect:
* From: http://example.dev/?s=Weekly+Screening
* To: http://example.dev/events/?tribe-bar-search=Weekly%20Screening
@vicskf
vicskf / functions.php
Last active May 21, 2020
Event Tickets > Send a copy of the RSVP or ticket email to all event organizers that have a valid email address
View functions.php
<?php
/**
* BCC event organizers email on all Event Tickets' RSVP and commerce ticket emails so they get a copy of it too
*/
function bcc_all_event_organizers( $headers, $event_id, $order_id ) {
//check if has organizer
if ( !tribe_has_organizer( $event_id ) ) {
return $headers;
}
@jentheo
jentheo / exclude-categories-all-views.php
Last active Oct 10, 2017
Exclude certain categories from all views (except category pages)
View exclude-categories-all-views.php
<?php
/*
* The Events Calendar Remove Events from All Views (Except Category Pages)
* add to theme's functions.php file
* @version 4.5.5
* replace these example slugs with your event category slugs: array( 'family-fun', 'bbq' )
*/
add_action( 'pre_get_posts', 'tribe_exclude_events_categories_all_views' );
@elimn
elimn / tribe_dequeue_script_example.php
Created Jun 16, 2017
MT | Example for deregistering a script
View tribe_dequeue_script_example.php
<?php
/**
* An example for how to dequeue a script
*
* Obtain the handle of your script by searching through the code, and then
* add a wp_deregister_script() function call for that handle.
*/
function tribe_dequeue_script_example() {
wp_deregister_script( 'tribe-events-jquery-resize' );
@cliffordp
cliffordp / functions.php
Last active Dec 13, 2020
Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
View functions.php
<?php
/**
* Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
*
* @link https://wordpress.org/plugins/woocommerce-product-dependencies/ May be a better and easier solution !!! !!! !!! (But I haven't tried it.)
*
* !!! Before using, edit the variables in this function according to your needs!!!
* Could maybe also do the inverse (if ticket product is removed from cart, also remove the chained product).
*
* From https://gist.github.com/cliffordp/30481ca323012e298418095476d49337
@cliffordp
cliffordp / functions.php
Last active Jul 3, 2017
Event Tickets - Remove Checked-In Attendees from wp-admin table
View functions.php
<?php
/**
* Event Tickets - Remove Checked-In Attendees from wp-admin table
*
* Can help the Attendees List table screen's performance after some of the attendees have been checked in.
* Modified from Barry's original version on May 24, 2017, to support all ticket types.
* Ideas: only do this if a specific query parameter exists, or only do this if a button is clicked (but then the point about this being a performance improvement would no longer be valid)
*
* @param $query
*
@andrasguseo
andrasguseo / change-wording-with-context.php
Created May 12, 2017
Change the wording of any bit of text or string, which has a context
View change-wording-with-context.php
<?php
function tribe_custom_theme_text_with_context ( $translation, $text, $context, $domain ) {
// Put your custom text here in a key => value pair
// Example: 'Text you want to change' => 'This is what it will be changed to'
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key => values, but make sure to separate them with a comma
// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
@cliffordp
cliffordp / functions.php
Last active Oct 17, 2018
BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
View functions.php
<?php
/**
* BCC multiple email addresses, including the site admin email address, on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* Updated 2018-01-18 for Event Tickets 4.5.2+
* HOWEVER, this has been tested and we think there might be an issue with
* the version of PHPMailer (what wp_mail() uses) included with WordPress, which
* is why BCCs are not working.
* Therefore, you can use this other snippet for how to initiate a new, separate
* email message to the Organizer (but it could be customized to go to someone