Forked from stephenh1988/venue-name-in-event-tooltip.php
Last active
December 13, 2015 22:59
-
-
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
This file contains 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 | |
/** | |
* 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