Created
February 5, 2015 04:37
-
-
Save bordoni/439bd58bbfbb7db3454b to your computer and use it in GitHub Desktop.
How to add the Venue on The Events Calendar Month Tooltip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a Wordpress Plugin you can install from Wordpress.org (https://wordpress.org/plugins/display-event-locations-tec/#description) or from Github (https://github.com/mike-weiner/display-event-locations-tec) that will accomplish this same change. Because it is within a plugin, you can continue to update your theme(s) as well!