Tribe__Tickets__Attendee_Registration__Main::is_modal_enabled( int|WP_Post|null $post = null )

Check if the modal is enabled.


Parameters

$post

(int|WP_Post|null) (Optional) The post (or its ID) we're testing. Defaults to null.

Default value: null


Top ↑

Return

(boolean)


Top ↑

Source

File: src/Tribe/Attendee_Registration/Main.php

	public function is_modal_enabled( $post = null ) {
		/** @var $settings_manager Tribe__Settings_Manager */
		$settings_manager = tribe( 'settings.manager' );

		$event_tickets_plus = class_exists( 'Tribe__Tickets_Plus__Main' );

		$option = $settings_manager::get_option( 'ticket-attendee-modal' );

		$activate_modal = $event_tickets_plus && $option;

		/**
		 * Allow filtering of the modal setting, on a post-by-post basis if desired.
		 *
		 * @since 4.11.0
		 *
		 * @param boolean $option The option value from ticket settings.
		 * @param int|WP_Post|null $post The passed post or null if none passed.
		 */
		return apply_filters( 'tribe_tickets_modal_setting', $activate_modal, $post );
	}

Top ↑

Changelog

Changelog
Version Description
5.6.7 Defaulted ticket-attendee-modal setting to true if never set.
4.11.0 Introduced.