Title: REQUEST: ics format shortcode
Last modified: August 24, 2016

---

# REQUEST: ics format shortcode

 *  [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/)
 * I was thinking of developing this, but seems like a perfect fit for event rocket.
 * I want to have a url I can access from google calendar to fill that in from my
   events, to access like [https://support.google.com/calendar/answer/37100?hl=en](https://support.google.com/calendar/answer/37100?hl=en)
 * I think it should by default have all of the events in the database, but as long
   as that can be configured in the shortcode arguments, that’s would work for me.
 * Standard The Events Calendar ics feed only returns the current month, I think,
   e.g., [http://steeplechasers.org/events/?ical=1](http://steeplechasers.org/events/?ical=1),
   and they were uninterested in making any changes for this.
 * [https://wordpress.org/plugins/event-rocket/](https://wordpress.org/plugins/event-rocket/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122365)
 * Interesting idea. How do you see it working? Would it be an extension of the 
   current **[event_embed]** shortcode?
 * `[event_embed limit="200" output="ical-button"]`
 * Something like the above?
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122368)
 * I hadn’t thought about the button, but that would be a bonus.
 * Not sure exactly what limit is doing. Maybe [event_embed from=”beginning” to=”
   end” output=”ical-button” text=”button text” name=”some title for google display”](
   not quite sure how the calendar name works in google calendar / ical, though)
 * Would the ical button would be formatted through css?
 * also [… output=”ical-url” …] would add flexibility.
 * I guess I had originally been thinking new short code, e.g., [event_ics …] or[
   event_ical …] — I bet that would that make the interface easier — do you agree?
   Then output=”button” or output=”url”, etc.
 * Else you could use event_embed and do something like format=”ical” output=”button”,
   allowing for other format types.
 * Thanks for considering this!
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122403)
 * The reason I’m thinking of extending an existing shortcode is that people then
   have the option of using it’s existing capabilities to target a specific set 
   of events (by date, category or whatever).
 * > Not sure exactly what limit is doing
 * It just limits the number of events – otherwise on sites with large numbers of
   events there is a risk that when the feed is generated the site would “crash”.
 * > also [… output=”ical-url” …] would add flexibility.
 * Good call, it may simply be better than a button and site admins can use it how
   they will.
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122461)
 * Thanks. So I assume you are accepting this feature request?
 * Will you also be adding from=”beginning” and to=”end” or similar? or is that 
   already available?
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122462)
 * (when I said “Not sure exactly what limit is doing”, I meant, does it take 200
   most recent, next 200, last 200 or first 200)
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122472)
 * > Thanks. So I assume you are accepting this feature request?
 * I certainly like that idea and have [logged an issue](https://github.com/barryhughes/event-rocket/issues/27)
   so I don’t lose track of it 🙂
 * > Will you also be adding from=”beginning” and to=”end” or similar? or is that
   > already available?
 * This sort of capability is already present – you can see a list of currently 
   accepted parameters and learn more about how the existing system works [here](https://github.com/barryhughes/event-rocket/wiki/Embed-Events).
 * Thanks again!
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122642)
 * Hi – I think you implemented this feature with a shortcode starting in 3.0. I
   finally had a chance to look at it. Unfortunately
 * `[eventrocket_ical_link from="-3 month" to="+12 month"] Download events in ical
   format! [/eventrocket_ical_link]`
 * only returns 10 events, and there are more events within the window.
 * See [http://sandbox.steeplechasers.org/event-ical-test/](http://sandbox.steeplechasers.org/event-ical-test/)
   for the source page for the above plugin, and you can click on Events in the 
   menu bar to see what it should have returned.
 * I am running v 3.2 of event rocket, and v 3.12 of the events calendar pro
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122643)
 * Actually, I was counting the number of VEVENT instances in the file, and there’s
   a BEGIN:VEVENT and an END:VEVENT, so it only returns 5 events.
 * This is the same a the ‘Number of events to show per page’ setting.
 * But if I change the shortcode arguments to include limit=2000, then I get 35 
   events. In that case, the filename is very large. See [http://sandbox.steeplechasers.org/event-ical-test-2/](http://sandbox.steeplechasers.org/event-ical-test-2/)
 * Should I infer that without the limit argument, the default number of events 
   per page is used?
 * Is there anything which can be done about the filename?
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122644)
 * Hi!
 * > Should I infer that without the limit argument, the default number of events
   > per page is used?
 * Yes: I probably should make this clearer in the docs, but I want users to be 
   explicit about how many posts should potentially be returned, since on sites 
   with a large number of events this has potential to cause problems if left unchecked.
 * > Is there anything which can be done about the filename?
 * Possibly, but can you clarify what you feel needs to be done?
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122645)
 * Well, when 5 events was returned the filename was ical-event-1031128910328821265.
   ics, but when 35 events was returned the filename was ical-event-1031128910328821265103310347871035103683410377781038691884676780698141371272778273482284289010667371045829847887784893.
   ics
 * Does the filename have encoded every event in the name? If that’s the case if
   a large number of events are returned the filename may exceed system limits.
 * I guess I don’t understand why the name gets longer.
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122646)
 * That’s a good observation and something I failed to catch (or may not have been
   a problem when I first wrote that piece of code).
 * What Event Rocket actually tries to do is set the filename to something like 
   this:
 * `20150910114819-4b3403665fea6.ics`
 * Not designed for its aesthetic charm, but it comprises two sections – the first
   representing the date/time of the request and the second being near-unique – 
   and is of a fixed length.
 * However, as with most things in Event Rocket, iCal generation fundamentally relies
   on The Events Calendar to do a lot of the legwork and, in this case, The Events
   Calendar is overwriting the suggested filename provided (like the one above) 
   with its own.
 * Unfortunately, there’s not currently a way around this unless I have Event Rocket
   take over the entire iCal generation process (and I’m not going to do that).
 * It does seem like a legitimate concern, though, since an exported list view or
   month view could also conceivably contain a large number of events and suffer
   the same problem – so I’ll be sure to log a bug on the tracker for The Events
   Calendar itself since it does seem silly to increase the filename in this manner
   without any checks.
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122647)
 * Yes I saw what you were trying to set in the code — that would be fine and manageable.
   Hopefully you can figure out a workaround for this.
 * Not sure how it affects my use case, though, as I’ll be putting the url into 
   google calendar as an alternate calendar, and I doubt it will actually end up
   as a file on some file system, rather it is most likely to be taking the stream
   data directly.
 * I haven’t yet followed my full use case. I’ll post here if I run into more difficulties.
 * But it might affect others who used this differently.
 * Thanks
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122648)
 * I tell a lie – it _might_ be possible to fix this up with a little hack. Let’s
   say you consistently want the filename to be ‘events.ics’:
 *     ```
       function ical_export_filename( $return ) {
           header( 'Content-Disposition: attachment; filename="events.ics"' );
           return $return;
       }
   
       add_filter( 'tribe_ical_properties', 'ical_export_filename' )
       ```
   
 * That should do the trick … but please note it is completely untested. (When I
   get a chance I’ll test and roll it into Event Rocket if it works.)
 *  Thread Starter [lking57](https://wordpress.org/support/users/lking57/)
 * (@lking57)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122649)
 * cool!

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘REQUEST: ics format shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/event-rocket_dacd8c.svg)
 * [Event Rocket](https://wordpress.org/plugins/event-rocket/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-rocket/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-rocket/)
 * [Active Topics](https://wordpress.org/support/plugin/event-rocket/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-rocket/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-rocket/reviews/)

## Tags

 * [events](https://wordpress.org/support/topic-tag/events/)

 * 14 replies
 * 2 participants
 * Last reply from: [lking57](https://wordpress.org/support/users/lking57/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/request-ics-format-shortcode/#post-6122649)
 * Status: not resolved