Update Arguments

The Events Calendar ORM can be used to update posts in the database. This function can be combined with the query arguments to refine which post(s) should be updated; otherwise all posts in the chosen repository will be updated.

The data to be updated can be declared with the ->set( 'key' , 'value' ) function or the ->set_args( $args ) function.

The ->save() functionality is available for any of the ORM Repositories (event, organizer, venue, ticket, and attendee).

Note: Our developers are currently investigating an issue where the event repository is returning NULL when trying to update. The internal ticket reference is BTRIA-2310.

Examples

Update all Venues to have the same phone number:

tribe_venues()->set( 'phone' , 1231231234 )->save();

Update a specific Organizer’s name:

tribe_organizers()->where( 'id' , 51 )->set( 'title' , 'Beyonce' )->save();