Skip to content

Instantly share code, notes, and snippets.

View sguilliard's full-sized avatar

Simon Guilliard sguilliard

View GitHub Profile
@jtcote
jtcote / gumwp_plugin_tribe_events_wootix_show_cost.php
Last active February 14, 2016 22:06
Tribe Events Plugin - wootickets add-on, show ticket cost and availability
add_filter( 'tribe_get_cost', 'gum_wootickets_tribe_get_cost', 10, 3 );
function gum_wootickets_tribe_get_cost( $cost, $postId, $withCurrencySymbol ) {
if ( empty($cost) && class_exists('TribeWooTickets') ) {
// see if the event has tickets associated with it
$wootickets = TribeWooTickets::get_instance();
$ticket_ids = $wootickets->get_Tickets_ids( $postId );
if ( empty($ticket_ids) ) {
return '';
@jbrinley
jbrinley / gist:6848286
Last active February 14, 2016 20:59
Filter Modern Tribe's Events Calendar to show ticket prices from the WooCommerce Tickets add-on. Add this to your theme's functions.php, or put it in an mu-plugin.
function my_wootickets_tribe_get_cost( $cost, $postId, $withCurrencySymbol ) {
if ( empty($cost) && class_exists('TribeWooTickets') ) {
// see if the event has tickets associated with it
$wootickets = TribeWooTickets::get_instance();
$ticket_ids = $wootickets->get_Tickets_ids( $postId );
if ( empty($ticket_ids) ) {
return '';
}
// see if any tickets remain, and what price range they have