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 | |
/* Tribe, merge venues util function */ | |
function merge_venues ( $venue_id, $merge_venues ) { | |
// let's check the venues_id is valid | |
if ( !tribe_is_venue( $venue_id ) ) return; | |
foreach ( $merge_venues as $merge_venue ) { |
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 | |
/* Force the display of the cost field of event on the Community Events submit form */ | |
add_filter( 'tribe_events_community_display_cost_section', '__return_true', 100 ); |
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
/* | |
* The Events Calendar - Redirect Mobile Users to List View | |
*/ | |
add_action( 'template_redirect', 'tec_mobile_template_redirect' ); | |
function tec_mobile_template_redirect() { | |
if( tribe_is_week() && wp_is_mobile() ) { | |
wp_redirect( tribe_get_listview_link() ); | |
exit(); | |
} | |
} |
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 | |
/* Tribe, limit ticket qty */ | |
function tribe_limit_tickets() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready( function( $ ) { | |
// do this if tickets available | |
if ( $('.tribe-events-tickets').length ) { | |
// set max qty to 1 |
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 | |
/* Tribe, hide cost for recurring instances other than the first */ | |
function tribe_hide_cost_for_recurring_instances ( $cost, $post_id, $with_currency_symbol ) { | |
$event = tribe_events_get_event( $post_id ); | |
if ( $event->post_parent > 0 ) { | |
$cost = ''; | |
} |
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_cost', 'tribe_not_show_free', 10, 3 ); | |
function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) { | |
if ( $cost == 0 || $cost == 'Free' ) { | |
$cost = str_replace('Free', '', $cost); | |
$cost = str_replace(' - ', '', $cost); | |
} | |
return $cost; | |
} |
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 | |
/* Additional functions for changing strings in the events calendar and its plugins | |
* See https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/ for details | |
* on the provided functions by the TEC team | |
* 1. - function for changing quantity based spelling | |
* 2. - function for changing strings with an attached context | |
*/ | |
function tribe_custom_theme_numbered_text ( $translation, $single, $plural, $number, $domain ) { |
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 | |
/** | |
* Hides cost from the single event details section | |
* | |
* @param string $tpl Template relative path | |
*/ | |
function tribe_single_hide_cost( $tpl ) { | |
if ( 'modules/meta/details.php' === $tpl ) { | |
add_filter( 'tribe_get_formatted_cost', '__return_empty_string' ); |
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 | |
/** | |
* Prevent calendar export links from showing anywhere on the front-end. | |
* | |
* | |
*/ | |
class Tribe__Events__Remove__Export__Links { | |
public function __construct() { | |
add_action( 'init', array( $this, 'single_event_links' ) ); |