0

I have an object that needs to be notified when a hook function is called, and act on the data from the hook?

1 Answer 1

0

Probably the thing to do is create another extension that listens for the same hook and give it a sufficiently high priority such that it fires last (or perhaps immediately following the instance of the hook you are interested in if the hook is likely to be called multiple times).

Within your new extension you can then retrieve the data from the previous use of the hook using the variable $this->extensions->last_call.

More on this in the documentation for EE4 here.

HTH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.