This file contains hidden or 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 | |
/** | |
* Tries to force the minicalendar widget to show the month of the next upcoming event by default, rather | |
* than simply showing the current month (which might be empty). | |
*/ | |
class Tribe_Advance_Minical | |
{ | |
protected $target_date = false; | |
/** |
This file contains hidden or 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 | |
/** | |
* Outline for replacing the existing datepicker with a custom filter field. | |
* | |
* (TEC 3.5) | |
*/ | |
add_action( 'init', 'replace_tribe_bar_search_field', 50 ); | |
function replace_tribe_bar_search_field() { | |
$callback = array( TribeEvents::instance(), 'setup_date_search_in_bar' ); |
This file contains hidden or 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_action( 'tribe_pre_get_view', 'occassionally_kill_pro_title_filter' ); | |
function occassionally_kill_pro_title_filter() { | |
remove_action( 'tribe_pre_get_view', 'occassionally_kill_pro_title_filter' ); | |
if ( ! tribe_is_photo() ) return; // You could extend or further limit when this runs | |
remove_filter( 'tribe_get_events_title', array( TribeEventsPro::instance(), 'reset_page_title')); | |
add_filter( 'tribe_get_events_title', 'modify_events_title' ); | |
} |
This file contains hidden or 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 | |
/** | |
* Change the position of the Eventbrite Tickets ticket form (within single event pages). | |
*/ | |
function change_eventbrite_ticket_position() { | |
// Do nothing if Eventbrite Tickets is not active | |
if ( ! class_exists( 'Event_Tickets_PRO' ) ) return; | |
// Get a reference to the callback method responsible for displaying the ticket form | |
$display_tickets = array( Event_Tickets_PRO::instance(), 'print_ticket_form' ); |
This file contains hidden or 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 | |
use Exception, | |
Zend\Filter\Decompress; | |
/** | |
* The gzip adapter for Zend's decompression filter doesn't always | |
* operate reliably on strings. This utility class transparently writes | |
* the string to a temp file and then passes it through the filter. | |
* |
This file contains hidden or 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_action( 'init', 'register_tea_flavours', 100 ); | |
add_action( 'parse_query', 'focus_on_events_for_tea_flavour_queries' ); | |
function register_tea_flavours() { | |
register_taxonomy( 'tea_flavours', TribeEvents::POSTTYPE, array( | |
'label' => 'Tea Flavours' | |
) ); | |
register_taxonomy_for_object_type( 'tea_flavours', TribeEvents::POSTTYPE ); | |
} |
This file contains hidden or 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 | |
/** | |
* Workaround for themes, plugins and customizations that rely on | |
* redirect_canonical() *not* redirecting when pagination is used | |
* on a static front page. | |
*/ | |
add_action( 'init', 'modify_pro_canonical_filter' ); | |
function modify_pro_canonical_filter() { | |
if ( ! class_exists( 'TribeEventsPro' ) ) return; |
This file contains hidden or 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 | |
/** | |
* Sample approach for removing action/filter functions belonging | |
* to anonymous objects. | |
*/ | |
function remove_anonymous_objects_from_wp_hooks() { | |
global $wp_filter; | |
// Specific hooks and priorities we want to search | |
$hooks = [ |
This file contains hidden or 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 | |
/** | |
* Generates output for the [public_attendee_list] shortcode. | |
* | |
* Assumes we're interested in the current event or, optionally, a specific | |
* event ID can be provided: | |
* | |
* [public_attendee_list id="789"] | |
* | |
* This is a rudimentary starting point only! Please assess and tweak to |