Tribe__Tickets_Plus__QR::get_qr_url( array $ticket )

Get QR Code URL from ticket.


Parameters

$ticket

(array) (Required)


Top ↑

Return

(string|null)


Top ↑

Source

File: src/Tribe/QR.php

	public function get_qr_url( $ticket ) {
		// if gzuncompress doesn't exist, we can't render QR codes
		if ( ! function_exists( 'gzuncompress' ) ) {
			tribe( 'logger' )->log_warning( __( 'Could not render QR code because gzuncompress() is not available', 'event-tickets-plus' ), __CLASS__ );
			return;
		}

		$enabled = tribe_get_option( 'tickets-enable-qr-codes', true );

		/**
		 * Filters the QR enabled value
		 *
		 * @since 5.6.10
		 *
		 * @param bool   $enabled       The bool that comes from the options
		 * @param array  $ticket        The ticket
		 */
		$enabled = apply_filters( 'tribe_tickets_plus_qr_enabled', $enabled, $ticket );

		if ( empty( $enabled ) ) {
			return;
		}

		$link = $this->_get_link( $ticket['qr_ticket_id'], $ticket['event_id'], $ticket['security_code'] );
		$qr   = $this->_get_image( $link );

		if ( ! $qr ) {
			return;
		}

		return $qr;
	}

Top ↑

Changelog

Changelog
Version Description
5.6.10 Introduced.