Skip to content

Instantly share code, notes, and snippets.

@bordoni
Created February 23, 2015 22:34
Show Gist options
  • Save bordoni/8acc6d505722587bd1a7 to your computer and use it in GitHub Desktop.
Save bordoni/8acc6d505722587bd1a7 to your computer and use it in GitHub Desktop.
How to add the event venue to the tooltip of the event
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
add_filter( 'tribe_events_template_data_array', 'tec_forum_939516', 11, 3 );
function tec_forum_939516( $json, $event, $additional ){
if ( tribe_has_venue( $event ) ){
$json['venue'] = 'Venue: <b>' . tribe_get_venue( $event ) . '</b>';
} else {
$json['venue'] = '';
}
return $json;
}
<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.length) { ]]
<p class="entry-venue">[[=raw venue]]</p>
[[ } ]]
<span class="tribe-events-arrow"></span>
</div>
</div>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment