IAC::get_iac_setting_for_ticket( Tribe__Tickets__Ticket_Object|int $ticket )
Get the IAC setting for a ticket.
Contents
Parameters
- $ticket
-
(Tribe__Tickets__Ticket_Object|int) (Required) The ticket object or ID.
Return
(string) The IAC setting for a ticket (none, allowed, required).
Source
File: src/Tribe/Attendee_Registration/IAC.php
public function get_iac_setting_for_ticket( $ticket ) {
$ticket_id = $ticket;
if ( is_object( $ticket ) ) {
$ticket_id = $ticket->ID;
}
if ( empty( $ticket_id ) ) {
return self::NONE_KEY;
}
$ticket_meta_key = $this->get_iac_setting_ticket_meta_key();
$iac_setting = get_post_meta( $ticket_id, $ticket_meta_key, true );
if ( empty( $iac_setting ) ) {
$iac_setting = self::NONE_KEY;
}
/**
* Allow filtering the IAC setting for a ticket.
*
* @since 5.1.0
*
* @param string $iac_setting The IAC setting for a ticket (none, allowed, required).
* @param int $ticket_id The ticket ID.
* @param \Tribe__Tickets__Ticket_Object|int $ticket The ticket object or ID as passed to the method.
*/
return apply_filters( 'tribe_tickets_plus_attendee_registration_iac_setting_for_ticket', $iac_setting, $ticket_id, $ticket );
}
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |