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_filter( 'tribe_events_community_sanitize_submission', function( $submission) { | |
| if ( empty( $_POST['tax_input'] ) ) { | |
| return $submission; | |
| } | |
| $submission['tax_input'] = array(); | |
| foreach ( $_POST['tax_input'] as $taxonomy => $terms ) { | |
| $taxonomy = filter_var( $taxonomy, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH ); |
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 | |
| // Don't load directly | |
| defined( 'WPINC' ) or die; | |
| $selected_terms = array(); | |
| $taxonomy_obj = get_taxonomy( $taxonomy ); | |
| $ajax_args = array( | |
| 'taxonomy' => $taxonomy, | |
| ); |
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 get_woo_ticket_purchaser_name( $ticket_id ) { | |
| $wootickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); | |
| $attendee_objects = $wootickets->get_attendees_by_id( | |
| $ticket_id, | |
| Tribe__Tickets_Plus__Commerce__WooCommerce__Main::ATTENDEE_OBJECT | |
| ); | |
| if ( count( $attendee_objects ) !== 1 ) { |
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 | |
| /** | |
| * Updates an Events Calendar PRO-style custom field. | |
| * | |
| * @param int $post_id | |
| * @param string $field_label | |
| * @param string $value | |
| */ | |
| function update_ecp_custom_field( $post_id, $field_label, $value ) { | |
| $custom_fields = (array) tribe_get_option( 'custom-fields' ); |
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
| This line is indented with an initial tab. | |
| This line is not indented. |
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 | |
| /** | |
| * Supports accessing and importing events upto 2yrs in the future when using | |
| * the "Other URL" import feature. | |
| * | |
| * Note that the source site may have a cap on the number of events it will | |
| * "yield". The "tribe_rest_event_max_per_page" filter hook can be used there | |
| * to increase that, if it is a site under your own control. | |
| */ |
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 | |
| /** | |
| * Alter list view queries to be accurate to the minute (vs accurate to the second) | |
| * to give additional opportunities for persistent caching to kick in. | |
| */ | |
| add_action( 'tribe_events_pre_get_posts', function( $event_query ) { | |
| // Only modify event list queries | |
| if ( 'list' !== $event_query->get( 'eventDisplay') ) { | |
| 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 | |
| /** | |
| * Enable support for multiple venues. | |
| */ | |
| add_filter( 'tribe_events_linked_post_type_args', function( $args ) { | |
| $args['allow_multiple'] = true; | |
| return $args; | |
| }, 100 ); |
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 | |
| /** | |
| * Require that a new or existing venue is specified when events are submitted via | |
| * the frontend submission form provided by Community Events. | |
| * | |
| * This is a temporary workaround for bug #76297. | |
| */ | |
| function ce_submissions_require_venue( array $submission ) { | |
| // Unhook self |
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 | |
| $mini_cal_event_atts = tribe_events_get_widget_event_atts(); | |
| $post_date = tribe_events_get_widget_event_post_date(); | |
| $post_id = get_the_ID(); | |
| $organizer_ids = tribe_get_organizer_ids(); | |
| $multiple_organizers = count( $organizer_ids ) > 1; | |
| $city_name = ! empty( $city ) ? tribe_get_region() : ''; |