Skip to content

Instantly share code, notes, and snippets.

@theeventscalendar
theeventscalendar / EventWebsiteLink2.php
Last active Dec 11, 2015 — forked from barryhughes/EventWebsiteLink.php
Make an Event Website a link instead of showing the text url. This version opens a new window with the additional target=blank code.
View EventWebsiteLink2.php
<?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 &raquo;";
}
return '<a href="' . tribe_get_event_website_url() . '" target="_blank">' . $label . '</a>';
}
@theeventscalendar
theeventscalendar / ticketsplus_woocommerce-products.php
Last active Sep 26, 2017 — forked from elimn/tribe_wootix_no_hijack.php
Allows customers to access the WooCommerce product page for tickets with Tickets Plus
View ticketsplus_woocommerce-products.php
<?php
/*
* Causes WooCommerce Ticket product pages to stop redirecting to their event page
* See https://theeventscalendar.com/knowledgebase/selling-tickets-from-the-woocommerce-products-page/
*/
function tribe_wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
@theeventscalendar
theeventscalendar / link_to_fb_event.php
Last active Nov 19, 2015 — forked from elimn/tribe_link_to_fb_event.php
Add a link to the original Facebook event from an imported event listing
View link_to_fb_event.php
@theeventscalendar
theeventscalendar / woo-disable-ticket-email
Last active Nov 14, 2015
WooCommerce Tickets 3.12.1 // Disable ticket email from sending
View woo-disable-ticket-email
/**
Plugin Name: WooCommerce Tickets: Disable Ticket Emails
Description: Turns off ticket emails that are automatically sent from WooCommerce Tickets
Version: 1.0
**/
function wootickets_email_no_no() {
return 'no';
}
@theeventscalendar
theeventscalendar / add-category-to-title.php
Created Sep 18, 2015 — forked from elimn/functions.php
Add category name(s) to event title
View add-category-to-title.php
<?php
// Prepends category name(s) to the event titles
function tribe_events_title_include_cat ($title, $id) {
$separator = ' &raquo; '; // HTML Separator between categories and title
$cats = get_the_terms($id, 'tribe_events_cat');
$is_ajax = defined('DOING_AJAX') && DOING_AJAX;
$is_truly_admin = is_admin() && !$is_ajax;
@theeventscalendar
theeventscalendar / set-ticket-default.php
Created Sep 18, 2015 — forked from anonymous/segment__tickets.php
Set a default quantity in the Ticket form
View set-ticket-default.php
woocommerce_quantity_input( array(
'input_name' => 'quantity_' . $ticket->ID,
'input_value' => 0,
'min_value' => 0,
'max_value' => $max_quantity,
) );
@theeventscalendar
theeventscalendar / add-event-title.php
Last active Nov 28, 2017 — forked from geoffgraham/gist:145f929f4547bb2c690e
Add event title to cart next to ticket name
View add-event-title.php
<?php
/**
* Example for adding event data to WooCommerce checkout for Events Calendar tickets.
* @link http://theeventscalendar.com/support/forums/topic/event-title-and-date-in-cart/
*/
add_filter( 'woocommerce_cart_item_name', 'woocommerce_cart_item_name_event_title', 10, 3 );
function woocommerce_cart_item_name_event_title( $title, $values, $cart_item_key ) {
$ticket_meta = get_post_meta( $values['product_id'] );
$event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] );
@theeventscalendar
theeventscalendar / event_limit_list_widget.txt
Last active Sep 17, 2015 — forked from geoffgraham/gist:f28a14fb13796ccecf39
Increase the number of events in the Advanced List Widget. See http://m.tri.be/18iv.
View event_limit_list_widget.txt
add_filter('widget_display_callback', 'increase_event_widget_limit', 10, 2);
/**
* Test if the current widget is an Advanced List Widget and fix the event limit if it is.
*/
function increase_event_widget_limit(array $instance, $widget) {
if (is_a($widget, 'Tribe__Events__Pro__Advanced_List_Widget'))
$instance['limit'] = 30;
return $instance;
@theeventscalendar
theeventscalendar / move-edd-tickets-form.txt
Created Sep 8, 2015 — forked from geoffgraham/gist:0c2f380a8efccdb57e09
Move EDD Tickets Form above Event content
View move-edd-tickets-form.txt
remove_action( 'tribe_events_single_event_after_the_meta', array( TribeEDDTickets::get_instance(), 'front_end_tickets_form'), 5 );
add_action( 'tribe_events_single_event_before_the_content', array( TribeEDDTickets::get_instance(), 'front_end_tickets_form') );
View change_events_view_titles.php
<?php
/*
* Alters event's archive titles
*/
function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) {
// Modify the titles here
// Some of these include %1$s and %2$s, these will be replaced with relevant dates
$title_upcoming = 'Upcoming Events'; // List View: Upcoming events
You can’t perform that action at this time.