Modifying public submission form values before saving to database

Home Forums Calendar Products Community Events Modifying public submission form values before saving to database

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1163825
    Jarno
    Participant

    I would like to be able to modify and validate (with error message to user if not correct) public event submission form field values with custom PHP code before they are saved to database.

    How would I accomplish this?

    #1164339
    Barry
    Member

    Hi Jarno,

    That’s a great question!

    The first thing I should highlight is that for custom development tasks like this one we tend to be pretty limited in terms of just how much detail we can go into. That said, I’d be happy to point you in the right direction if I can 🙂

    In terms of validating fields and throwing custom errors, this knowledgebase article may be a help:

    theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form

    It doesn’t cover modifying submitted values but given your objectives it is definitely worth reading. In terms of altering the events after submission, you may also be interested in the following hooks:

    • tribe_community_event_created (for new events)
    • tribe_community_event_updated (for pre-existing events)

    By adding your own callbacks for these actions (the event ID of the relevant post will be passed to your callback) you can take further action and potentially modify the saved post and its post meta data if you wish to do so.

    Again, this is a fairly bespoke customization to make so we can’t go into too much depth, but hopefully this will be enough to get you started.

    Good luck!

    #1173316
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Modifying public submission form values before saving to database’ is closed to new replies.