Resend_Tickets_Handler::add_resend_tickets_action( array $row_actions, array $item )

Add Re-send tickets action item in the attendee list actions.


Parameters

$row_actions

(array) (Required) Row action items.

$item

(array) (Required) Attendee data for the row.


Top ↑

Return

(array)


Top ↑

Source

File: src/Tribe/Service_Providers/Resend_Tickets_Handler.php

	public function add_resend_tickets_action( array $row_actions, array $item ) {

		if ( ! isset( $item['event_id'] ) ) {
			return $row_actions;
		}

		$event_id = $item['event_id'];

		/** @var \Tribe__Tickets__Attendees $attendees */
		$attendees = tribe( 'tickets.attendees' );

		if ( ! $attendees->user_can_manage_attendees( 0, $event_id ) ) {
			return $row_actions;
		}

		/**
		 * Allow alteration of max resend ticket count.
		 *
		 * @since 5.2.5
		 *
		 * @param int $max Maximum allowed nnumber of send tickets.
		 * @param array $item Attendee Item data.
		 */
		$ticket_sent_threshold = absint( apply_filters( 'event_tickets_attendee_resend_tickets_max_allowed', 10, $item ) );

		if ( $ticket_sent_threshold <= $item['ticket_sent'] ) {
			return $row_actions;
		}

		$label = __( 'Re-send Ticket', 'event-tickets-plus' );
		$link  = sprintf( '<button class="button-link re-send-ticket-action" type="button" data-attendee-id="%1$s" data-provider="%2$s">%3$s</button>', $item['attendee_id'], $item['provider'], $label );

		$row_actions[] = '<span class="inline re-send_ticket">' . $link . '</span>';

		return $row_actions;
	}

Top ↑

Changelog

Changelog
Version Description
5.2.5 Introduced.