Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / ical-export-events-custom.php
Last active May 15, 2018 21:53
TEC - iCal export of this year's events
<?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 October 27, 2017 19:36
The Events Calendar PRO: Make tribe_is_week() return TRUE even for tribe_events shortcode.
<?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 August 23, 2018 05:15
The Events Calendar: Redirect all site searches to be Tribe Bar Keyword searches.
<?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 June 12, 2023 16:30
Event Tickets > Send a copy of the RSVP or ticket email to all event organizers that have a valid email address
<?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 October 10, 2017 21:58
Exclude certain categories from all views (except category pages)
<?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 June 16, 2017 19:18
MT | Example for deregistering a script
<?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 September 8, 2022 14:31
Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
<?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 July 3, 2017 21:50
Event Tickets - Remove Checked-In Attendees from wp-admin table
<?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 20:21
Change the wording of any bit of text or string, which has a context
<?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 October 17, 2018 19:56
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
<?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