WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to change the behavior of one function in a plugin. Instead of rewriting the file and having to deal with updates I would prefer a solution that works similar to the way add_filter works for the wordpress core. Is this possible using either php or wordpress?

share|improve this question
up vote 0 down vote accepted

If there are hooks in the function, this is possible, if not, there may be pluggable functions, where you can replace their function with your own custom function. I have not seen pluggables in plugins frequently, but with most of the more popular plugins, you do see actions and filters.

You may be able to interact with the plugin by changing the behavior of the functions which it calls to your desired effect. This can be tricky, and often results in hacky solutions, but it's better than nothing.

If there is not a way to interact with the plugin, then you can fork the plugin's code. Naturally, this is the least desirable, but it may be your only option.

share|improve this answer
+1 And I would fork the code and send the code back to plugin author to see if they are willing to include it in the main plugin code. This way everyone wins and I am least bothered. – Ashfame May 5 '12 at 7:06

I think you should send a message to the author of the plugin, so that he would have added hooks do_action() and apply_filters() to a desired location in the code. Then even when you upgrade you will not lose functionality. Or use that constructions if(function_exists('plugin-function'))

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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