Feature proposal: Hook for approval
-
Dear EME developers,
for a website I needed an EME hook which is called when a booking order is approved. I’ve looked into the documentation and into the EME source code and found that there is no such hook. (Please correct me if I’m wrong.)
Since having such an approval hook was crucial for my website, I created one myself. This was extremely easy to do, mainly because the EME source code is very readable and well structured. Here I’d like to share my changes.
I simply added the following few lines to the end of the function
eme_approve_booking()
in the fileeme_rsvp.php
:if (has_action('eme_approve_rsvp_action')) { $booking = eme_get_booking($booking_id); do_action('eme_approve_rsvp_action', $booking); }
The hook introduced in this way I called
eme_approve_rsvp_action
. It can be used by callingadd_action()
in the usual way:add_action('eme_approve_rsvp_action', 'my_approval_hook');
Since it would be cumbersome to add the lines from above each time EME gets updated and
eme_rsvp.php
is overwritten, I’d like to propose to put this new hook into the official EME package (maybe including a brief hint in the documentation). In this way it can be used by others (and myself) in the future without modifying the EME source code.Many thanks in advance,
Alexander VoigtP.S.: Please feel free to adapt/change/discard my code as you like! I can also provide further help, for example by providing the change in form of a patch or so.
- The topic ‘Feature proposal: Hook for approval’ is closed to new replies.