Creating recurring events programmatically

Home Forums Calendar Products Events Calendar PRO Creating recurring events programmatically

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1091350
    William Ranney
    Participant

    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);
    #1091353
    George
    Participant

    Hey @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,
    George

    #1097556
    Support Droid
    Keymaster

    This 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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Creating recurring events programmatically’ is closed to new replies.