Tribe__Tickets__REST__V1__Endpoints__QR::should_checkin_qr_events_happening_now( int $event_id, int $attendee_id )
Check if the QR codes should be only checked when the event is on date and time.
Contents
Parameters
- $event_id
-
(int) (Required) The ID of the event.
- $attendee_id
-
(int) (Required) The ID of the current attendee of the QR code.
Return
(boolean) True if it should be checking-in tickets for events that are on date and time.
Source
File: src/Tribe/REST/V1/Endpoints/QR.php
public function should_checkin_qr_events_happening_now( $event_id, $attendee_id ): bool {
// Bail if TEC is not active.
if ( ! tec_tickets_tec_events_is_active() ) {
return false;
}
// Bail if `tribe_events` CPT is not enabled to have tickets.
$enabled_post_types = (array) tribe_get_option( 'ticket-enabled-post-types', [] );
if ( ! in_array( Tribe__Events__Main::POSTTYPE, $enabled_post_types, true ) ) {
return false;
}
$should_checkin_qr_events_happening_now = (bool) tribe_get_option( 'tickets-plus-qr-check-in-events-happening-now', false );
/**
* Filter the option for QR codes to be only checked in when an event is happening.
*
* @since 5.6.2
* @deprecated 5.7.0 Use `tec_tickets_qr_checkin_events_happening_now` instead.
*
* @param bool $should_checkin_qr_events_happening_now True if it should check in QR codes on events that are on date an time.
* @param int $event_id The ID of the event, from the current attendee of the QR code.
* @param int $attendee_id The ID of the current attendee of the QR code.
*/
$should_checkin_qr_events_happening_now = (bool) apply_filters_deprecated(
'tec_tickets_plus_qr_checkin_events_happening_now',
[ $should_checkin_qr_events_happening_now, $event_id, $attendee_id ],
'5.7.0',
'tec_tickets_qr_checkin_events_happening_now'
);
/**
* Filter the option for QR codes to be only checked in when an event is happening.
*
* @since 5.7.0
*
* @param bool $should_checkin_qr_events_happening_now True if it should check in QR codes on events that are on date an time.
* @param int $event_id The ID of the event, from the current attendee of the QR code.
* @param int $attendee_id The ID of the current attendee of the QR code.
*/
$should_checkin_qr_events_happening_now = (bool) apply_filters( 'tec_tickets_qr_checkin_events_happening_now', $should_checkin_qr_events_happening_now, $event_id, $attendee_id );
return $should_checkin_qr_events_happening_now;
}
Changelog
| Version | Description |
|---|---|
| 5.7.0 | Introduced. |