• Resolved jlherren

    (@jlherren)


    I was using ICS Calendar 10 with a custom view. My short code is [ics_calendar url="..." view="custom"] and I registered a few filters and actions using a code snippet plugin, roughly looking like this:

    add_action('r34ics_display_calendar_render_template', function ($view, $args, $ics_data) {
    // my custom code...
    return $result;
    }, 10, 3);

    I updated to version 11 and now it just renders in month mode. I can switch between ‘month’, ‘list’, etc, but ‘custom’ just doesn’t work anymore. Has this feature been removed? I didn’t read anything about this in the changelog.

    Any help is appreciated, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author room34

    (@room34)

    I’m sorry this is happening! Unfortunately it was born of my assumption that few if any users would have actually created custom views.

    As of version 11, if you have custom views you need to add them to the array of views using this filter:

    add_filter('r34ics_views', function($views) {
    $views[] = 'custom';
    return $views;
    }, 10, 1);

    Based on your post I assume custom is the actual name of the view you’ve created, but if it’s something else, you’d need to put that in place of custom in this sample code.

    Let me know if this doesn’t work properly for you.

    Note: This is documented here: https://icscalendar.com/developer/#r34ics_views

    • This reply was modified 1 month, 1 week ago by room34.
    Thread Starter jlherren

    (@jlherren)

    Spot on! Yes I gave the view a random name, because I saw from the code it would then always go into the switch’s default branch that way. I now gave it a proper name and together with your r34ics_views filter and it all works again now!

    Thank you so much for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.