Hi,
What do I have to do to let the tooltip on te full calendar show the excerpt from an event?
Thanks!

Siger Smit
Hi Siger,
The plug-in by default uses an excerpt of the event content. To use the user-entered excerpt (or more generally to change the description), you can use the hook eventorganiser_event_tooltip
(see codex for an example).
Please note that the calendar is cached. You’ll need to clear the cache (e.g. update an event) before changes will take effect.
Given the event ID you can get the user-entered excerpt like so:
$post = get_post( $event_id );
$excerpt = $post->post_excerpt;

Stephen Harris
Hi Stephen,
Thanks, this works, but it seams that te full calendar takes a lot more time to load, for a visitor it may seem there are no events at all… I used this code:
add_filter('eventorganiser_event_tooltip', 'my_event_tooltip_excerpt', 10,2);
function my_event_tooltip_excerpt( $excerpt, $event_id, $post){
$post = get_post( $event_id );
$excerpt = $post->post_excerpt;
return $excerpt;
}
Is this correct?
Thanks, Siger
-
This reply was modified 10 years ago by
Siger Smit.

Siger Smit
Nope, that 2
should be 3
, it indicates the number of arguments being passed to the callback (also note the the third argument is the occurrence ID, not the post object).
Not tested, but this should work:
add_filter( 'eventorganiser_event_tooltip', 'my_callback_function', 10, 4 );
function my_callback_function( $description, $event_id, $occurrence_id, $post ){
return $post->post_excerpt;
};
-
This reply was modified 10 years ago by
Stephen Harris.

Stephen Harris