Recurring events – start and end date not set after create
-
Hello,
we own the The Events Calendar PRO license so I could use your premium support but the problem is that the licences are managed by our global support team and I would say that it could take much more time to find some way how to create an account for our local team so we could communicate with you directly. This is the reason why I am using this free support forum.
To the problem. We use WPML on our website so I was thrilled to hear that you have finally completed your integration of recurring events with this multilingual plugin. Thanks for this!
The thing is that we have a custom build plugin that synchronize all our events (kept in the Events Calendar) with Google Calendar using Google Calendar API. Basically, whenever an event is updated it is pushed to the Google Calendar via API. Everything works just fine but the problem comes with recurring events.
I am using this hook to interact with the event after it is saved:
add_action('save_post', 'syncWithGoogleCalendar', 20, 1);
The hook works just fine – it is fired once for each of the recurrence. But the problem is that when I use your function
tribe_get_start_date($post->ID, true, DateTime::RFC3339, 'Europe/Prague')
id doesn’t return the correct DateTime of the start (actually it returns the time when the function is used). I’ve found out that this is probably used by the fact that the ‘_EventStartDate’ meta is not set at the time so somewhere in your plugin constructor of DateTime with empty attribute is called.Interesting fact is that once the request is completed you can find the meta value in database. So I would say that the start and end date is set after I try to get it using the mentioned function. This fact is also supported by the fact that once the recurrences are created and you hit the Update button with no changes the start and end DateTimes are properly set.
I’ve tried to increase the priority attribute of the action to something like 5000 but it did not help at all.
Can you help me with this issue as soon as possible?
Thanks in advance!
- The topic ‘Recurring events – start and end date not set after create’ is closed to new replies.