iCalendar_Handler::single_event_links( string $calendar_links )

Replace (overwrite) the default single event links with subscription links.

See also


Top ↑

Parameters

$calendar_links

(string) (Required) The link content.


Top ↑

Return

(string) The altered link content.


Top ↑

Source

File: src/Tribe/Views/V2/iCalendar/iCalendar_Handler.php

	public function single_event_links( $calendar_links ) {
		// If someone has opted out of the new subscribe links - don't change anything!
		if ( ! $this->use_subscribe_links() ) {
			return $calendar_links;
		}

		$calendar_links = '<div class="tribe-events-cal-links">';

		$links = [];
		/**
		 * Allows each link type to add itself to the links on the Event Single views.
		 *
		 * @since 5.12.0
		 *
		 * @param array<string|string> $subscribe_links The array of link objects.
		 * @param View|null            $view            The current View implementation.
		 */
		$links = apply_filters( 'tec_views_v2_single_subscribe_links', $links, null );

		// Remove any that are empty post-filtering.
		$links = array_filter( $links );

		foreach ( $links as $link ) {
			$calendar_links .= $link;
		}

		$calendar_links .= '</div><!-- .tribe-events-cal-links -->';

		return $calendar_links;
	}

Top ↑

Changelog

Changelog
Version Description
5.16.0 - Move to Single_Events class to handle Outlook.
5.12.0 Introduced.