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 | |
/** | |
* Allows visitors to page forward/backwards in any direction within month view | |
* an "infinite" number of times (ie, outwith the populated range of months). | |
*/ | |
class ContinualMonthViewPagination { | |
public function __construct() { | |
add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) ); | |
add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) ); |
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 | |
// Checks the URL for the debug parameter | |
// example.com/event/event-name/?tribe_query_debug=true | |
function tribe_events_pre_get_posts_dumper ($query) { | |
$show_debug_info = isset($_GET['tribe_query_debug']) ? $_GET['tribe_query_debug'] : false; | |
if(($show_debug_info == "true" && $query->is_main_query() === true) || $show_debug_info == "full") { | |
echo "<h3><Tribe Events Query></h3>"; | |
tribe_spit_it_out($query); |
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 | |
// Fixes bug in TEC 3.8 | |
// Edits of events will now update the month view browsable date range | |
function tribe_listen_for_event_updates() { | |
if ( class_exists( 'TribeEvents' ) ) | |
add_action( 'save_post_' . TribeEvents::POSTTYPE, 'tribe_force_update_event_date_range' ); | |
} | |
add_action( 'init', 'tribe_listen_for_event_updates' ); |
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_option', 'tribe_adjust_embedded_map_height', 10, 2 ); | |
function tribe_adjust_embedded_map_height( $value, $property ) { | |
if ( 'embedGoogleMapsHeight' !== $property ) return $value; | |
return '350px'; |
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 | |
/* | |
* Possible solution for Single Event page 404 errors where the WP_Query has an attachment set | |
* IMPORTANT: Flush permalinks after pasting this code: http://tri.be/support/documentation/troubleshooting-404-errors/ | |
*/ | |
function tribe_attachment_404_fix () { | |
if (class_exists('TribeEvents')) { | |
remove_action( 'init', array( TribeEvents::instance(), 'init' ), 10 ); | |
add_action( 'init', array( TribeEvents::instance(), 'init' ), 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 | |
/* | |
* Set's Tec's preferred area for search results from the Location search in Tribe Bar | |
*/ | |
function tribe_set_geo_lookup_bounds ($localizations) { | |
// SW corner of your bounds rectangle | |
$localizations['geocenter']['max_lat'] = '49'; | |
$localizations['geocenter']['max_lng'] = '-8'; |
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 | |
/* | |
* This allows you to escape characters in TEC date formats | |
* | |
* Example date format: F \d\e j, Y | |
* Example date: dezembro de 31, 2014 | |
* http://codex.wordpress.org/Formatting_Date_and_Time#Escaping | |
* | |
* You can change these formats in WP Admin > Events > Settings > Display | |
*/ |
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 | |
/* | |
* Set the default date for views like List and Month | |
* Modify the $date variable below to set your date | |
*/ | |
function tribe_set_default_date( $wp_query ) { | |
// Only run on main event queries | |
if ( ! tribe_is_event_query() || ! $wp_query->is_main_query() || $wp_query->get( 'eventDate' ) != '') 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 | |
/* | |
* This changes the event link to the event website URL if that is set. | |
* NOTE: Comment out the add_filter() line to disable this function. | |
*/ | |
function tribe_set_link_website ( $link, $postId ) { | |
$website_url = tribe_get_event_website_url( $postId ); | |
// Only swaps link if set | |
if ( !empty( $website_url ) ) { |
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 | |
/* | |
* Prevents Tribe Thanks for Updating page from automatically displaying | |
*/ | |
function tribe_remove_activation_page() { | |
if ( class_exists( 'Tribe__Events__Activation_Page' ) ) { | |
remove_action( 'admin_init', array( Tribe__Events__Activation_Page::instance(), 'maybe_redirect' ), 10, 0 ); | |
} |