I’ve created a plugin that utilizes the following hook:
add_action( 'save_post', 'xxxxxxxxx' );
However, as you know this save_post occurs on much more than espresso events. I’m trying to get this to only function during creation/edit of espresso events. There was something similar for publishing events here, but that doesn’t seem to be working. I’ve also tried searching through the core code for all AHEE__EE items as well. Any help appreciated.
btw, the save_post hook above does work, but works for much more than it needs to 🙂
You can actually use save_post, but you’ll need to add a conditional where you check the post type and if the post type isn’t espresso_events, then return.
There’s some example code you can follow in the WordPress codex:
//check to see if this event is espresso_events. if so, then create, otherwise return
$post_type = get_post_type($post_id);
if ( "espresso_events" != $post_type ) return;
Viewing 3 reply threads
The support post ‘Add action hook for save espresso event’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.