Hi,
We’ve been using the following snippet of yours for some time to set edited events to return to pending status:
add_filter( 'tribe_events_community_sanitize_submission', 'set_community_events_publication_status' );
function set_community_events_publication_status( $submission ) {
$submission['post_status'] = 'pending';
return $submission;
}
This has worked perfectly up until recently, when an update to the core plugin appears to have broken this. While it still returns published events to pending status upon being edited, the snippet creates an issue with the Start and End Date for events. Specifically, with the above snippet in function.php, if a user attempts to submit or edit an event via the Community Events form and is returned an error (e.g. they didn’t include the event title or another required field), then the Start Date and End Date are both reset (to the current date for new events, or in the case of events being edited, the date in the database). With the above snippet removed, this issue is not present.
User’s aren’t expecting the dates to be reset and thus all of our newly submitted events are being submitted with the current dates, while edited events that are missing required fields are having their original dates submitted again even though the user had updated the date prior to trying to submit the form.
Any ideas on what we need to do to continue setting edited events to return to pending status (a must for our site) with it not resetting the event dates for events?
Thank you,
Karly