Tribe__Tickets__Attendees::get_checkedin_percentage( int $post_id )
Get Check In Percentage.
Contents
Parameters
- $post_id
-
(int) (Required) The post ID.
Return
(string)
Source
File: src/Tribe/Attendees.php
public function get_checkedin_percentage( $post_id ): string {
$total_checked_in = $this->get_checkedin_total();
$total = Tribe__Tickets__Tickets::get_event_attendees_count( $post_id );
// Remove the "Not Going" RSVPs.
$not_going = tribe( 'tickets.rsvp' )->get_attendees_count_not_going( $post_id );
$total -= $not_going;
if ( $total_checked_in === 0 || $total <= 0 ) {
return '0%';
}
return round( ( $total_checked_in / $total ) * 100 ) . '%';
}
Changelog
| Version | Description |
|---|---|
| 5.6.5 | Introduced. |