I need to write a function in my own plugin and overwrite a function from another plugin and (preferably) not make any changes to it. Or WordPress' core. So, basically, what I need to happen is: plugin X do it's work, it's time for function Y to do something, and instead of X's Y function, my function comes and do Y's job. Then X goes back to it's other functions.

I know the question has been asked before (some 3-4 years ago, when there were hooks) but any help'd be appreciated.


Unless the plugin itself provides hooks that you can use, or has been written is such a way as to be replaceable (a dicey proposition for a plugin), you can't. This isn't a WordPress restriction. It is a PHP one. You cannot "overload" or redefine functions in PHP. You will get a fatal error.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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