Last active
January 5, 2021 17:46
-
-
Save skyshab/2baa5e03060956fc5d817e9945ec473a to your computer and use it in GitHub Desktop.
Hide QR code from email if event has virtual event 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 | |
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