Export ALL events to ics file?

Home Forums Calendar Products Events Calendar PRO Export ALL events to ics file?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1007076
    Drew Nelson
    Participant

    Hi there… I just purchased the pro plugin, and love it. Wondering if there is a way to put a button for ALL the events to be downloaded into an ICS file? I see there is an option for monthly, but not the entirety

    Thanks!

    #1007419
    George
    Participant

    Hey Eric,

    Thanks for purchasing Events Calendar Pro and for the kind words about it! I’m sorry to relay the news that getting all events into the generated .ics feed is unfortunately not possible unless you were to modify core plugin code; namely the generate_ical_feed() method in The Events Calendar’s class called “Tribe__Events__iCal”, which is located in the following file: the-events-calendar/src/Tribe/iCal.php.

    The closest alternative you can use without modifying core code is to use the following filter: tribe_ical_feed_month_view_query_args.

    This lets you adjust the query arguments used for the .ics feed when events are retrieved for a given month; the way you could tweak this here is to just change the start_date and end_date parameters.

    What I mean is this: normally, the query arguments set the start_date as the first day of whatever month you’re exporting for, with the end_date set to the last day of the month. This, of course, defines what the month actually is and then gets all the events within that month.

    While it’s not quite truly getting “ALL events”, if you were to change these start_date and end_date parameters so that instead of looking inside one month, the function looks inside a whole year or something, it might be more useful for your site.

    We don’t offer support for custom code, unfortunately, so this is just a rough sketch of what I’m describing, but here’s some custom code I wrote that would – in theory – make the “month” range actually start on Jan. 1 2015 and go until Dec 31. 2016. That’s quite a large span, so if this does work, don’t be surprised if your requests time out or anything! 🙂 But play around with this, and see if it helps at all!


    add_filter( 'tribe_ical_feed_month_view_query_args', 'tribe_support_1007076' );

    function tribe_support_1007076( $args ) {

    if ( ! is_array( $args ) )
    return $args;

    if ( ! isset( $args['start_date'] ) || ! isset( $args['end_date'] ) )
    return $args;

    $args['start_date'] = date( Tribe__Events__Date_Utils::DBDATETIMEFORMAT, strtotime( '1 January 2015' ) );
    $args['end_date'] = date( Tribe__Events__Date_Utils::DBDATETIMEFORMAT, strtotime( '31 December 2016' ) );

    return $args;
    }

    I hope all this helps!

    Cheers,
    George

    #1007454
    Drew Nelson
    Participant

    George,

    Thank you for this detailed reply.

    Curious where I can submit this as a feature request? This is a great product, but to be honest for $89 a year I am shocked that this isn’t an option for the Pro feature as is? Many of the free plugins have this as an option.

    Thanks!

    #1007856
    George
    Participant

    Hey Eric,

    I appreciate your feedback in this thread already and would love for you to vocalize your concerns about this feature – you can do so at our official UserVoice page here: http://tribe.uservoice.com

    Deciding what to make an “option” is always a tricky thing because we want our options panels to remain as lean as possible, and decide upon sensible defaults so that things “just work” out of the box. We tried to strike a balance here by at least adding the filter I demonstrated above, so that it is somewhat customizable…

    But definitely share your ideas on the UserVoice page. If other folks vote on your idea and it turns out that many people do want this as a simple admin option, then there’s no reason not to add it! 🙂

    Thanks for your feedback Eric, I’m sorry that you’re a bit disappointed with our plugins but hope that improvements in forthcoming releases make you a bigger fan of our work!

    Best of luck with your site,
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Export ALL events to ics file?’ is closed to new replies.