Add Category to Tooltip

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15797

    Hello,

    Do you have an existing function that shows the categories in the tooltips on the calendar? Or would you be able to point me in the right direction?

    Thanks.

    Neil Moeller
    #15810

    Hi Neil,

    You can use the filter: eventorganiser_event_tooltip (see codex).

    Here’s a simple (untested) example. Please note that the calendar is cached so changes will only take affect once that’s cleared (i.e. event is updated).

    add_filter('eventorganiser_event_tooltip', 'my_event_tooltip_content', 10,2);
    function my_event_tooltip_content( $description, $event_id ){
    
        if( get_the_terms( $event_id, 'event-category' ) ){
            //Append category list
            $description .= get_the_term_list( $event_id, 'event-category', '<p>Categories: ', ', ', '</p>' );    
        }
    
        return $description;
    }
    
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.