Skip to content

Instantly share code, notes, and snippets.

@Camwyn
Forked from skyshab/example.php
Last active January 5, 2021 17:50
Show Gist options
  • Save Camwyn/c3e3739cd63386c3cabec655ce080b81 to your computer and use it in GitHub Desktop.
Save Camwyn/c3e3739cd63386c3cabec655ce080b81 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 ( empty( $ticket['event_id'] ) ) {
return $enabled;
}
$event = tribe_get_event( $ticket['event_id'] );
if ( empty( $event ) || ! $event instanceof \WP_Post ) {
return $enabled;
}
if ( ! tribe_is_truthy( $event->virtual ) ) {
$enabled
}
return false;
},
10,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment