RSVP::should_show_qr_code( Tribe__Template $et_template )
Determines if QR code for Emails is Active.
Contents
Parameters
- $et_template
-
(Tribe__Template) (Required) Event Tickets template object.
Return
(boolean)
Source
File: src/Tickets_Plus/Emails/Email/RSVP.php
public function should_show_qr_code( $et_template ): bool {
$args = $et_template->get_local_values();
// bail out if the email is not a RSVP email or if the ticket email settings are being used.
if ( ! $args['email'] instanceof RSVP_Email ) {
return false;
}
$is_preview = Arr::get( $args, 'preview', false );
if ( $is_preview && isset( $args['add_qr_codes'] ) ) {
return tribe_is_truthy( $args['add_qr_codes'] );
}
$option_key = self::$option_ticket_include_qr_codes;
// if using Ticket settings, then include from Ticket class.
if ( tribe( RSVP_Email::class )->is_using_ticket_email_settings() ) {
$option_key = Ticket::$option_ticket_include_qr_codes;
}
return tribe_is_truthy( tribe_get_option( $option_key, true ) );
}
Changelog
| Version | Description |
|---|---|
| 5.7.0 | Introduced. |