Add class to event in fullcalendar

This topic contains 1 reply, has 1 voice, and was last updated by  B+eo 8 years, 2 months ago.

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

    Hello

    Is there a filter to add more css classes to an event in fullcalendar?

    I have events with a special meta key and I’d like to add a class to the event when this meta key has a specific value. Do I have to work with the eventorganiser_fullcalendar_event filter? How do I accomplish that?

    B+eo
    #23394

    I should think & try before posting … Here ‘s the solution:

    add_filter( 'eventorganiser_fullcalendar_event', 'specialpost_class', 10, 3 );
    function specialpost_class( $event, $event_id, $occurrence_id ) {
    $specialpost = ( get_post_meta( $event_id, 'specialpost', true ) === '1') ? true : false;
    if ( $specialpost ) {
    $event['className'][] = 'specialpost';
    }
    return $event;
    };

    • This reply was modified 8 years, 2 months ago by  B+eo.
    • This reply was modified 8 years, 2 months ago by  B+eo.
    B+eo
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.