I want to be able to alter a function inside another module like a hook, but I'm not sure if that's what it's called. I want to alter a function inside another module from my module without changing the external modules code.

This is in version 7.x.

Thanks Frank N.

1 Answer 1


PHP offers no mechanism to do that.

If the external function isn't a hook (i.e. it doesn't use module_invoke() or drupal_alter() to gather data from other modules) then the only thing you can do is patch the function in the external file.

  • Thank you, I wasn't sure but I thought I'd ask. Mar 24, 2013 at 9:33

Your Answer

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

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