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 to functions.php of your active theme | |
| add_filter( 'tribe_events_community_sanitize_submission', 'set_community_events_publication_status' ); | |
| function set_community_events_publication_status( $submission ) { | |
| // Escape, assuming default is set to 'draft' and 'allow anonymous submits' | |
| if ( ! is_user_logged_in() ) return $submission; | |
| $submission['post_status'] = 'publish'; | |
| return $submission; | |
| } |
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 | |
| /** | |
| * Sets the default date for event queries. | |
| * | |
| * Expects to be called during tribe_events_pre_get_posts. Note that this | |
| * function modifies $_REQUEST - this is needed for consistency because | |
| * various parts of TEC inspect that array directly to determine the current | |
| * date. | |
| * |
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_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' ); | |
| } | |
| } |
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
| // 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 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
| /** | |
| * 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 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
| 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 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 | |
| $count = 0; | |
| echo '<ul>'; | |
| foreach ( $tickets as $ticket ) { | |
| global $product; | |
| $count++; | |
| if ( class_exists( 'WC_Product_Simple' ) ) $product = new WC_Product_Simple( $ticket->ID ); | |
| else $product = new WC_Product( $ticket->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 | |
| /* | |
| * 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 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 | |
| // 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 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 | |
| /** | |
| * 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() { |