Home › Forums › Calendar Products › Events Calendar PRO › Creating recurring events programmatically
- This topic has 2 replies, 3 voices, and was last updated 8 years ago by Support Droid.
-
AuthorPosts
-
March 19, 2016 at 8:40 am #1091350William RanneyParticipant
Hello,
I was wondering if there’s a way to make a recurring event using the calendar’s API.
At one point I was able to do this, but that could have been a couple major versions ago.
Here’s a simplified snippet of what used to work for me:
$recurr = array( "type" =>"Every Week", "end-type" =>"Never", "end" => "", ); $event = array( 'post_title' => "Event Title", 'post_status' => 'publish', 'post_content' => "Event description", 'EventStartDate' => "2016-05-22", 'EventEndDate' => "2016-05-22", 'EventAllDay' => false, 'EventStartHour' => '5', 'EventStartMinute' => '00', 'EventStartMeridian ' => 'am', 'EventEndHour' => '6', 'EventEndMinute' => '00', 'EventEndMeridian ' => 'am', 'Recurrence' => $recurr, ); $e = tribe_create_event($event);
March 19, 2016 at 8:51 am #1091353GeorgeParticipantHey @wranne,
Thank you for reaching out. Our event recurrence system has gotten much more sophisticated and complex than the sort of array of options that you demonstrate in your example snippet.
Creating recurring events programmatically is technically possible, but is a complex custom-coding project that you will have to take the reins on yourself (or hire a professional developer to help). I’m sorry about this! Custom coding projects are just not something within the scope of support we can provide—see the “Product Support” section of this page for more information: http://theeventscalendar.com/terms
For some insight into how the plugin itself creates recurring events, you can check out the class
Tribe__Events__Pro__Recurrence__Events_Saver
inside Events Calendar Pro—by exploring this class and its methods, and all of the other objects and methods it calls upon, you might be able to put together some code that creates recurring-event series accurately.I wish you the best of luck with your custom project—let me know if there’s anything else I can try to help with here!
Sincerely,
GeorgeApril 3, 2016 at 9:35 am #1097556Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Creating recurring events programmatically’ is closed to new replies.