Home › Forums › Calendar Products › Events Calendar PRO › tribe_update_event
- This topic has 2 replies, 3 voices, and was last updated 10 years ago by
Support Droid.
-
AuthorPosts
-
March 16, 2016 at 5:10 pm #1090073
Keith
ParticipantI’m trying to do exactly what was mentioned in this post. I want to add a venue to an event without changing the event. Could you post an example here of how to add a venue (or an organiser) to an event, supplying just the minimal number of mandatory parameters?
The documentation doesn’t seem to have been updated since that post, 2 years ago. I guess it’s still on the radar. Nico mentioned in another thread that he is raising a ticket to update the documentation for tribe_create_event because there are several undocumented parameters.
Could you post a summary of those in this thread? Just something quick. I really think the basic functions such as tribe_create_event and tribe_update_event should be well documented.
March 17, 2016 at 2:50 pm #1090660Nico
MemberHey Keith,
Glad to help you here once again! You are raising interesting points here…
This functions args point to the tribe_create_event description so they are outdated as well! The ticket to update this docs is already created and surely be fixed soon 🙂
In this case the use case is a bit trickier, and in cases like this it’s usually necessary to dig a bit into the code to understand how it works and validates data. In this particular case the venue get’s changed if Venue is defined in the $args array, there also has to be a VenueID inside of Venue. Finally it’s necessary to have any other venue field defined as well. So for example you can do the following:
$event_id = 161;
$venue_id = 38;$args['Venue']['VenueID'] = $venue_id;
$args['Venue']['post_title'] = tribe_get_venue( $venue_id );tribe_update_event ( $event_id, $args );
The post_title param is just for the validation to pass.
Please give the code a try and let me know about it,
Best,
NicoApril 1, 2016 at 9:35 am #1097094Support Droid
KeymasterThis 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 ‘tribe_update_event’ is closed to new replies.
