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 | |
/** | |
* Block: RSVP | |
* Actions - Success - Toggle | |
* | |
* Override this template in your own theme by creating a file at: | |
* [your-theme]/tribe/tickets/v2/rsvp/actions/success/toggle.php | |
* | |
* See more documentation about our Blocks Editor templating system. | |
* |
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 | |
// Hide past or current events that started before today from the calendar views. | |
add_filter( 'tribe_events_views_v2_view_repository_args', function( $args, $context, $view ) { | |
$args['starts_on_or_after'] = current_time('Y-m-d H:i:s'); | |
return $args; | |
}, 10, 3 ); |
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 | |
// Register the action for the Edit order screen. | |
add_filter( 'woocommerce_order_actions', 'tec_event_tickets_plus_wc_register_force_regenerate_attendees' ); | |
// Register the bulk action for the Orders screen. | |
add_filter( 'bulk_actions-edit-shop_order', 'tec_event_tickets_plus_wc_register_force_regenerate_attendees' ); | |
/** | |
* Register the custom action to the list of order actions. |
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 | |
// Filter to remove tickets plugins scripts that conflict with the Page Optimize plugin. | |
add_filter( 'js_do_concat', function( $do_concat, $handle ) { | |
// Exclude any scripts with "tribe-" in the handle. | |
if ( strpos($handle, 'tribe-') !== false ) { | |
return 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 | |
// Hide members only tickets from ticket form when using Paid Memberships Pro. | |
// Works by assigning a product category and defining the membership needed. | |
add_filter( 'tribe_template_context', function($context, $file, $name, $obj){ | |
// bail if not the target template, or if membership plugin isn't active | |
if ( 'v2/tickets' !== implode("/", $name) || ! function_exists( 'pmpro_hasMembershipLevel' ) ) { | |
return $context; | |
} |
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_events_community_form', function( $event_id, $event, $template ){ | |
add_filter( 'the_content', 'do_shortcode', 999 ); | |
}, 100, 3); |
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 | |
// Allow all IAC attendees to view protected content. | |
add_filter( 'tribe_tickets_shortcode_can_see_content', static function( $can_see_content, $filter_args ) { | |
// Only run our logic below if the user is logged in or if they cannot currently see the content. | |
if ( ! is_user_logged_in() || $can_see_content ) { | |
return $can_see_content; | |
} | |
// Get the logged in user. |
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_tickets_ticket_add', function( $post_id, $ticket ){ | |
$post_title = get_the_title( $post_id ); | |
if( strpos( $ticket->name, $post_title ) === 0 ) return; | |
$new_name = $post_title . ' - ' . $ticket->name; |
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 | |
// Remove an asset that was registered with Tribe Assets (v2 only). | |
// The asset name can be found by finding where the file is loaded | |
// in the site head. The value to use will be the ID of the style | |
// or script block. | |
add_action('wp_enqueue_scripts', function() { | |
tribe('assets')->remove('tribe-tickets-plus-modal-styles'); | |
}); |
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 | |
// Replace this value with the event id | |
$my_event_id = 123; | |
// Replace this value with the correct number of capacity | |
// that should be displaying for shared capacity tickets. | |
$correct_remaining_tickets = 9; | |
add_action( 'init', function() { |