• Resolved XCTrails

    (@xctrails)


    Hi,

    I need to hook into an event delete (or better event trash) but apparently, em_event_delete_hook (or em_event.php:delete()) is never called, at least not when I trash an event from the list of events.

    How can I hook into an event delete/trash?

    Thanks,
    Armin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter XCTrails

    (@xctrails)

    So I figure I would need an additional apply_filter (?) in EM_Event_Post_Admin::trashed_post so that I can hook into that from my own code…?

    Hi ??
    EM User here..

    You can simply hook into the WordPress hook: delete_post(). Check the WordPress Codex for more info. Events are (down the line) normal WP posts, of course.

    If you have Yoast SEO, but not Premium you will notice they hook into delete_post() as well – every time I delete an EM event, I get a (very) annoying admin notice. Perhaps you could look in their code for an example? ??

    Thread Starter XCTrails

    (@xctrails)

    Thanks, I’ll look into that!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hook into event trash/delete’ is closed to new replies.