Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(New) venue lost if save_post is triggered twice #202

Closed
stephenharris opened this issue Jul 11, 2014 · 0 comments
Closed

(New) venue lost if save_post is triggered twice #202

stephenharris opened this issue Jul 11, 2014 · 0 comments
Labels

Comments

@stephenharris
Copy link
Owner

This was originally reported here: http://wp-event-organiser.com/forums/topic/custom-save-post-interferers-with-venue-saving/#post-11631.

When an event is saved with a new venue, the venue details are $_POSTed, but not ID is given. Event Organiser's callback recognises a venue (but no ID) is given so creates a venue.

However, if that callback is called again on the request (e.g. third party code calls wp_update_post()), since there is still no venue ID it attempts to create the venue (again). This fails because it's a duplicated venue. Consequently the callback sets the venue ID to null, and the venue-event link is lost.

Instead, if when creating a venue a term_exists error is encountered, we should retrieve the existing venue ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant