Support

Home Forums Event Espresso Premium Adding Custom Fields to iCal

Adding Custom Fields to iCal

Posted: August 28, 2023 at 11:29 am

Viewing 7 reply threads


zcsiteadmin

August 28, 2023 at 11:29 am

Hi,
We host a monthly series via webconference, but instead of creating 12 venues, we chose to use Advanced Custom Fields and created fields for the webconference url and call-in details.
Placing those details into our approval emails has worked fine, but we also want to put that information into the iCal calendar holds to make things simpler for our attendees. Is there a guide/template for doing this? Would the ACF Fields or EVENT_META fields be used in the code?
Thanks in advance for your help.


Tony

  • Support Staff

August 28, 2023 at 3:39 pm

Hi there,

The iCal data is filtered through:

apply_filters('FHEE__EED_Ical__download_ics_file_ics_data', $ics_data, $datetime);

$ics_data is an array which EE loops over to output the values as ke => value pairs, the filter is passed the datetime so you have the event using:

$event = $datetime->event();

The event ID:

$EVT_ID = $event->ID();

With that you can pull in the ACF fields for your post if that’s what you are using 🙂

Does that help?


zcsiteadmin

August 29, 2023 at 12:07 pm

This reply has been marked as private.


Tony

  • Support Staff

August 29, 2023 at 12:53 pm

There are a few problems with that code, it won’t work as is.

$EVT_ID is going to be a number so you can’t run methods on a number.

$ics_data[‘WEBEXCONF;VALUE=TEXT’] where are you getting that name for a field in the ical from?

You’re going to get a field with the name ‘WEBEXCONF;VALUE=TEXT’ and a URL as a value, but will whatever client you are using to open the iCAL know what that is?


zcsiteadmin

August 29, 2023 at 12:56 pm

This reply has been marked as private.


Tony

  • Support Staff

August 29, 2023 at 1:32 pm

$ics_data['DESCRIPTION'] .= $webex; would append the $webex string to the end of the description.

Have you figured out how to pull the value from the custom field?


zcsiteadmin

August 29, 2023 at 2:36 pm

Through some manner of miracle, I’ve figured the rest out! Thanks so much for your help.


Tony

  • Support Staff

August 29, 2023 at 3:37 pm

Congrats, job well done and you’re most welcome 🙂

Viewing 7 reply threads

The support post ‘Adding Custom Fields to iCal’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso