[add] define_hook for before/after hooks