Skip to content

Instantly share code, notes, and snippets.

@skyshab
Last active January 5, 2021 17:46
Show Gist options
  • Save skyshab/2baa5e03060956fc5d817e9945ec473a to your computer and use it in GitHub Desktop.
Save skyshab/2baa5e03060956fc5d817e9945ec473a to your computer and use it in GitHub Desktop.
Hide QR code from email if event has virtual event url
<?php
add_filter( 'tribe_tickets_plus_qr_enabled', function($enabled, $ticket) {
if ( ! isset( $ticket['event_id'] ) ) {
return $enabled;
}
$event = tribe_get_event( $ticket['event_id'] );
$is_virtual = get_post_meta( $event->ID, '_tribe_events_is_virtual', true);
if ( ! $is_virtual || '' === $is_virtual ) {
return $enabled;
}
return false;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment