When does remove_filter not work?

Well this is somehow a very specific topic that is bound to a WordPress development issue. I strongly suggest you to keep track of the trac ticket if you liked my article. That is the best thing you can do I assume for finding out when the problems come into play as well how to circumvent them technically (if you don’t like the don’t use remove_filter()-answer).

Take it from a theoretic standpoint: It’s just that the used datatypes are not strictly dealt with to ensure the same functionality on all possible values (f(n) != f(n)). In short: a broken design.

Does this mean it will always break in practise? – No! It’s just that it can happen sometimes. And then you’re trapped when you need to rely on remove_filter().

A better suggestion might be this one: If you develop plugins that make use of hooks as class methods, ensure that the plugin get executed on installations with PHP 5.2 / 5.3.

Please keep the technical discussion in the trac ticket. And if you’re seriously interested, please help to fix the shortcomings of the current design.

Leave a Comment