Help Center
Find answers or browse our knowledge base.
Latest Questions
event_form_save
Available Hook: event_form_save
When an event is created or edited, the system automatically triggers:
$this->do_action('event_form_save', $event_id, $_POST);
This means your addon can listen for the event_form_save
hook without modifying core files. The hook passes:
$event_id
→ ID of the event being created/edited$_POST
→ The form data submitted for the event
How to Use It in an Addon
Create a file in your addon under modules/
. Return a callable function that receives $event_id
and $args
(the POST array).
query(sprintf(
"UPDATE events SET
event_has_form = %s,
event_form_url = %s,
event_form_code = %s
WHERE event_id = %s",
secure($has_form, 'int'),
secure($form_url),
secure($form_code),
secure($event_id, 'int')
));
};
Debugging
If your hook doesn’t fire, confirm that:
- The file is named exactly
event_form_save.php
undermodules/
/hooks/ - Your function
return
s a closure - You are using
$this->do_action()
(already integrated in the event system)
This hook system is reusable — you can attach any extra logic (logging, notifications, integrations) without editing the core event files.
Was this answer helpful?
You must login to vote.
0 found this helpful,
0 did not
How could it be better?
What went wrong?
Thank you for your feedback!