Glance_Items::custom_glance_items_attendees( array $items = array() )
Custom glance item for Attendees count.
Contents
Parameters
- $items
-
(array) (Optional) The array of items to be displayed.
Default value: array()
Return
(array) $items The maybe modified array of items to be displayed.
Source
File: src/Tickets/Admin/Glance_Items.php
public function custom_glance_items_attendees( $items = [] ): array { $results = Tribe__Tickets__Tickets::get_attendees_by_args( [] ); $total = count( $results['attendees'] ); if ( empty( $total ) ) { return $items; } // Translators: %s Is the number of attendees. $text = _n( '%s Attendee', '%s Attendees', $total, 'event-tickets' ); $text = sprintf( $text, number_format_i18n( $total ) ); $items[] = sprintf( '<span class="tec-tickets-attendees-count">%1$s</span>', $text ) . "\n"; return $items; }