Skip to content

Instantly share code, notes, and snippets.

<?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' );
@theeventscalendar
theeventscalendar / tribe-events-title-month.php
Created August 14, 2015 23:07 — forked from anonymous/tribe-events-title-month.php
Change the title for the Month View page
<?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';
@theeventscalendar
theeventscalendar / tribe-events-title-tag.php
Created August 14, 2015 23:06 — forked from anonymous/tribe-events-title-tag.php
Change the title tags on various event pages
<?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() ) {
@theeventscalendar
theeventscalendar / add-prev-next-links.php
Last active August 29, 2015 14:27 — forked from BeardedGinger/prevnext.php
Adds Previous/Next Month links to Month View even when no future/past events exist
@theeventscalendar
theeventscalendar / past-event-reverse-order.php
Created August 10, 2015 22:55 — forked from elimn/functions.php
Change past event views to reverse chronological order
<?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);
}
@theeventscalendar
theeventscalendar / link-directly-to-website-url.php
Last active January 15, 2019 19:55 — forked from elimn/tribe_set_link_website.php
Change event or venue links in The Events Calendar to the relevant website URL
@theeventscalendar
theeventscalendar / show-phone-number-attendees-list.php
Last active August 29, 2015 14:24
Show the purchaser's phone number in the Tickets attendee list.
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;
@theeventscalendar
theeventscalendar / org-email-mailto.php
Created July 7, 2015 21:55 — forked from barryhughes/live-click-org-email.php
Makes the Organizer email a mailto link on single event pages
/**
* 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>';
}
@theeventscalendar
theeventscalendar / callable phone numbers.php
Created June 24, 2015 22:45 — forked from geoffgraham/gist:011974ea4d1df5551e1a
Make venue and organizer phone numbers into callable links
// 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>';
@theeventscalendar
theeventscalendar / events in main loop by publish date.php
Last active August 29, 2015 14:23 — forked from anonymous/revised.php
Orders events in your main blog loop by the event publish date instead of the event date.
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' );
}
}