Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stephenharris/4988322 to your computer and use it in GitHub Desktop.
Save stephenharris/4988322 to your computer and use it in GitHub Desktop.
Adds the venue's name to the content appearing in the tooltip when hovering over an event in fullcalendar
<?php
/**
* Requires Event Organiser 1.6+
*
* Adds the venue's name to the content appearing in the tooltip when hovering over an event in fullcalendar
* @uses eventorganiser_event_tooltip filter.
*
* The filter passes 4 objects: the content of the toolip, the post ID of the event, the occurrence ID
* of the event and the post object (the last one probably won't often bed needed).
* In this example we just need the first two.
*/
add_filter('eventorganiser_event_tooltip', 'my_event_tooltip_content', 10,2);
function my_event_tooltip_content( $description, $post_id ){
$venue_id = eo_get_venue($post_id);
if( $venue_id ){
//Event has a venue, append this to the event description.
$description = 'This event is at '.eo_get_venue_name($venue_id).'</br></br>'.$description;
}
return $description;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment