cliffordp
2/28/2018 - 3:35 AM

How to add the Venue on The Events Calendar Month Tooltip

How to add the Venue on The Events Calendar Month Tooltip

<?php
// File: /tribe-events/month/tooltip.php
/**
 *
 * Please see Single_Event.php in this directory for detailed instructions on how to use and modify these templates.
 *
 */

?>

<script type="text/html" id="tribe_tmpl_tooltip">
	<div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip">
		<h4 class="entry-title summary">[[=title]]</h4>

		<div class="tribe-events-event-body">
			<div class="duration">
				<abbr class="tribe-events-abbr updated published dtstart">[[=dateDisplay]] </abbr>
			</div>
			[[ if(imageTooltipSrc.length) { ]]
			<div class="tribe-events-event-thumb">
				<img src="[[=imageTooltipSrc]]" alt="[[=title]]" />
			</div>
			[[ } ]]
			[[ if(excerpt.length) { ]]
			<p class="entry-summary description">[[=raw excerpt]]</p>
			[[ } ]]
			[[ if(venue) { ]]
			<p class="entry-venue">Venue: <a href="[[=venue_link]]">[[=venue_title]]</a></p>
			[[ } ]]
			<span class="tribe-events-arrow"></span>
		</div>
	</div>
</script>
<?php
/*
 * If you already have something in your functions.php, please remove these first few lines
 */
 
function tec_forum_939516( $json, $event, $additional ){

	$venue = tribe_get_venue_id( $event );
	if ( $venue ){
		$json['venue'] = $venue;
		$json['venue_link'] = tribe_get_venue_link( $venue, false );
		$json['venue_title'] = tribe_get_venue( $venue );
	}

	return $json;
}
add_filter( 'tribe_events_template_data_array', 'tec_forum_939516', 10, 3 );