eo_update_event
since 1.5
eo_update_event( $post_id, $event_data = array(), $post_data = array() )
This functions updates a post of event type, with data given in the $post_data and event data given in $event_data. Returns the post_id.
Triggers eventorganiser_save_event passing event (post) ID
The event data array can contain
schedule
=> (custom | once | daily | weekly | monthly | yearly) -- specifies the recurrence pattern
schedule_meta
=>
- For monthly schedules,
- (string) BYMONTHDAY=XX to repeat on XXth day of month, e.g. BYMONTHDAY=01 to repeat on the first of every month.
- (string) BYDAY=ND. N= 1|2|3|4|-1 (first, second, third, fourth, last). D is day of week SU|MO|TU|WE|TH|FR|SA. E.g. BYDAY=2TU (repeat on second tuesday)
- For weekly schedules,
- (array) Days to repeat on: (SU,MO,TU,WE,TH,FR,SA). e.g. set to array('SU','TU') to repeat on Tuesdays & Sundays.
- Can be left blank to repeat weekly from the start date.
frequency
=> (int) positive integer, sets frequency of recurrence (every 2 days, or every 3 days etc)
all_day
=> 1 if its an all day event, 0 if not
start
=> start date (of first occurrence) as a datetime object
end
=> end date (of first occurrence) as a datetime object
until
=> START date of last occurrence (or upper-bound thereof) as a datetime object
schedule_last
=> Alias of until. Deprecated 2.13.0, use until.
number_occurrences
=> Instead of specifying until
you can specify the number of occurrence a recurring event should have.
This is only used if until
is not, and for daily, weekly, monthly or yearly recurring events.
include
=> array of datetime objects to include in the schedule
exclude
=> array of datetime objects to exclude in the schedule
Parameters
int
|
$post_id |
- the event (post) ID for the event you want to update
|
array
|
$event_data = array() |
- array of event data
|
array
|
$post_data = array() |
- array of data to be used by wp_update_post.
|
Return value
int
|
$post_id - the post ID of the updated event
|
Hooks
Changelog