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 | |
| /** | |
| * 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 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 | |
| /** | |
| * 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 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 | |
| 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 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 | |
| tribe_get_template_part( 'wootickets/tickets', null, array( | |
| 'tickets' => Tribe__Events__Tickets__Tickets::get_all_event_tickets( get_the_ID() ) | |
| ) ); | |
| ?> |
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 | |
| /* | |
| * Alters event's archive titles | |
| */ | |
| function tribe_alter_event_archive_titles ( $original_recipe_title, $depth ) { | |
| // Modify the titles here | |
| // Some of these include %1$s and %2$s, these will be replaced with relevant dates | |
| $title_upcoming = 'Upcoming Events'; // List View: Upcoming events |
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
| remove_action( 'tribe_events_single_event_after_the_meta', array( TribeEDDTickets::get_instance(), 'front_end_tickets_form'), 5 ); | |
| add_action( 'tribe_events_single_event_before_the_content', array( TribeEDDTickets::get_instance(), 'front_end_tickets_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
| add_filter('widget_display_callback', 'increase_event_widget_limit', 10, 2); | |
| /** | |
| * Test if the current widget is an Advanced List Widget and fix the event limit if it is. | |
| */ | |
| function increase_event_widget_limit(array $instance, $widget) { | |
| if (is_a($widget, 'Tribe__Events__Pro__Advanced_List_Widget')) | |
| $instance['limit'] = 30; | |
| return $instance; |
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 | |
| /** | |
| * Example for adding event data to WooCommerce checkout for Events Calendar tickets. | |
| * @link http://theeventscalendar.com/support/forums/topic/event-title-and-date-in-cart/ | |
| */ | |
| add_filter( 'woocommerce_cart_item_name', 'woocommerce_cart_item_name_event_title', 10, 3 ); | |
| function woocommerce_cart_item_name_event_title( $title, $values, $cart_item_key ) { | |
| $ticket_meta = get_post_meta( $values['product_id'] ); | |
| $event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] ); |
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
| woocommerce_quantity_input( array( | |
| 'input_name' => 'quantity_' . $ticket->ID, | |
| 'input_value' => 0, | |
| 'min_value' => 0, | |
| 'max_value' => $max_quantity, | |
| ) ); |
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 | |
| // Prepends category name(s) to the event titles | |
| function tribe_events_title_include_cat ($title, $id) { | |
| $separator = ' » '; // HTML Separator between categories and title | |
| $cats = get_the_terms($id, 'tribe_events_cat'); | |
| $is_ajax = defined('DOING_AJAX') && DOING_AJAX; | |
| $is_truly_admin = is_admin() && !$is_ajax; |