Template_Modifications::add_event_single_video_embed()

Adds video embed to event single.

Contents


Source

File: src/Tribe/Template_Modifications.php

	public function add_event_single_video_embed() {
		// don't show on password protected posts.
		if ( post_password_required() ) {
			return;
		}

		$event = tribe_get_event( get_the_ID() );

		if ( ! $event instanceof \WP_Post) {
			return;
		}

		// Only embed when the source is video.
		if ( 'video' !== $event->virtual_video_source ) {
			return;
		}

		// Don't show if requires log in and user isn't logged in.
		if ( ! $this->should_show_virtual_content( $event ) ) {
			return;
		}

		$context = [
			'event' => $event,
		];

		$this->template->template( 'single/video-embed', $context );
	}

Top ↑

Changelog

Changelog
Version Description
1.6.0 - Add video source support.
1.0.4 Added possible login requirement.
1.0.0 Introduced.