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 wootix_no_hijack() { | |
if ( ! class_exists( 'Tribe__Events__Tickets__Woo__Main' ) ) return; | |
$woo_tickets = Tribe__Events__Tickets__Woo__Main::get_instance(); | |
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 ); | |
} | |
add_action( 'init', 'wootix_no_hijack' ); |
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 | |
/** | |
* Defines alternative titles for month view. | |
* | |
* @param string $title | |
* @return string | |
*/ | |
function filter_events_title_month( $title ) { | |
if ( tribe_is_month() ) { | |
$title = 'Month view page'; |
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 | |
/** | |
* Defines alternative titles for various event views. | |
* | |
* @param string $title | |
* @return string | |
*/ | |
function filter_events_title( $title ) { | |
// Single events | |
if ( tribe_is_event() && is_single() ) { |
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). | |
*/ | |
if ( class_exists( 'Tribe__Events__Main' ) ) { | |
class ContinualMonthViewPagination { | |
public function __construct() { |
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 | |
// Changes past event views to reverse chronological order | |
function tribe_past_reverse_chronological ($post_object) { | |
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false; | |
if(tribe_is_past() || $past_ajax) { | |
$post_object = array_reverse($post_object); | |
} |
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
if ( function_exists( 'tribe_is_event') ) { | |
/** | |
* Adds the phone number to the "Purchaser Email" column. | |
* @link http://theeventscalendar.com/support/forums/topic/add-attendee-telephone-number-to-attendee-list/ | |
*/ | |
function tribe_953653_add_phone_to_attendee_list( $value, $item, $column ) { | |
// Change this column name to move the phone number to a different column. | |
if ( 'purchaser_email' != $column ) { | |
return $value; |
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
/** | |
* Convert organizer emails into live "mailto:" links that users can click on. | |
* | |
* @param $email | |
* @return string | |
*/ | |
function organizer_live_email_link( $email ) { | |
if ( ! is_email( $email ) || ! is_singular( Tribe__Events__Main::POSTTYPE ) ) return $email; | |
return '<a href="mailto:' . esc_attr( $email ) . '">' . esc_html( $email ) . '</a>'; | |
} |
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
// Link the Venue Phone Number | |
add_filter( 'tribe_get_phone', 'filter_link_the_phone' ); | |
function filter_link_the_phone( $phone ) { | |
return '<a href="tel:' . $phone . '">' . $phone . '</a>'; | |
} | |
// Link the Organizer Phone Number | |
add_filter( 'tribe_get_organizer_phone', 'filter_link_the_organizer_phone' ); | |
function filter_link_the_organizer_phone( $phone ) { | |
return '<a href="tel:' . $phone . '">' . $phone . '</a>'; |
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
add_action( 'pre_get_posts', 'tribe_post_date_ordering', 51 ); | |
function tribe_post_date_ordering( $query ) { | |
if ( ! empty( $query->tribe_is_multi_posttype ) ) { | |
remove_filter( 'posts_fields', array( 'Tribe__Events__Query', 'multi_type_posts_fields' ) ); | |
$query->set( 'order', 'DESC' ); | |
} | |
} |