This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If a (ticket) product is updated via the WooCommerce product editor | |
* or even via quick edits then attempt to keep the cost fields in sync. | |
* | |
* @param int $product_id | |
*/ | |
function tempfix_62004_sync_ticket_price( $product_id ) { | |
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return; | |
if ( ! tribe_events_product_is_ticket( $product_id ) ) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modify the purchase email template according to the sort of products | |
* that have been ordered. | |
* | |
* This is just an example/rough outline and it doesn't concern itself | |
* with the possibility that other product types besides physical and | |
* downloadable might exist ;-) | |
* | |
* @param string $template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If the order is determined to contain no tickets, sets up a filter | |
* preventing the 'wootickets' email from being dispatched. | |
* | |
* @param int $order_id | |
*/ | |
function stop_empty_ticket_emails( $order_id ) { | |
$contains_tickets = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modify the "bases" used to form event URLs for various views. | |
* | |
* @param array $bases | |
* | |
* @return array | |
*/ | |
function rename_event_view_slugs( $bases ) { | |
if ( isset( $bases['month'] ) ) $bases['month'] = [ 'calendar', 'calendar' ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Once setup, this WP HTTP transport does a couple of things: | |
* | |
* 1) it means calls to wp_http_get() etc don't result in anything | |
* actually being sent on the wire | |
* | |
* 2) if a save directory is specified it will save a text representation | |
* of the request in that directory | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds email and name columns to the attendee export data (CSV only). | |
* | |
* Filters via the tribe_events_tickets_attendees_csv_items hook; intended for use | |
* with the initial 4.1 release of Event Tickets and Event Tickets Plus in | |
* combination with EDD only. | |
* | |
* @param array $items | |
* @return array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds email and name columns to the attendee export data (CSV only). | |
* | |
* Filters via the tribe_events_tickets_attendees_csv_items hook; intended for use | |
* with the initial 4.1 release of Event Tickets/Event Tickets Plus in combination | |
* with WooCommerce only. | |
* | |
* @param array $items | |
* @return array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Delete expired events. | |
-- | |
-- Use at own risk and consider running on a test set of data first of all! | |
-- As is, should remove all events that have expired by more than one week, | |
-- with the exception of parent events for recurring events which will be | |
-- left in place. | |
-- | |
-- Assumes a standard table prefix of "wp_" - adjust as required to match | |
-- your installation. | |
DELETE FROM wp_posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function temp_fix_42765( $date ) { | |
global $wp_query; | |
if ( ! empty( $wp_query->get( 'eventDate' ) ) ) | |
return $date; | |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) | |
return $date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'tribe_get_event_website_link_label', 'tribe_get_event_website_link_label_default' ); | |
function tribe_get_event_website_link_label_default( $label ) { | |
if ( $label === tribe_get_event_website_url() ) { | |
$label = "Visit Website »"; | |
} | |
return '<a href="' . tribe_get_event_website_url() . '" target="_blank">' . $label . '</a>'; | |
} |