Created
November 8, 2012 18:45
-
-
Save stephenh1988/4040699 to your computer and use it in GitHub Desktop.
Include venue name in an event's calendar tooltip
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
/** | |
* 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; | |
} |
This is a bit late, but to anyone coming across this code snippet now and find that the tooltip doesn't show the venue after adding this to your functions.php, you will need to update the event before it will take effect as the calendar is cached.
Info taken from this post:
https://wp-event-organiser.com/forums/topic/add-more-details-to-calendar-tooltip/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have put this in my functions.php in a child theme and it doesn't seem to work.
Also, as shown at the top of http://docs.wp-event-organiser.com/shortcodes/calendar/ I would like to get the tooltips on recurring events to say something like "Every Thursday, 7:00pm - 9:00pm" instead of the individual dates.
My site is http://pinkdancecalendar.info
My functions.php looks like this:
'.$description; } return $description; ``` }