Home ยป Remove Action Hooks and Filters defined in classes.

Remove Action Hooks and Filters defined in classes.

In my previous post, i explained and walked through the process of removing actions from Hooks and Filters.
In this post I will cover how to un-hook action and filters that have been defined in classes.

Firstly lets cover the singleton class a very popular way of defining plugins in WordPress environment.
A singleton class only allows one instance of a class to be created. Singleton.

There are many advantage of using this, one of which is other developers can remove filters you’ve defined in your class. Here is a code example of how:

The more troublesome part is when plugin developers and there are quite a few do not take into account that maybe a user needs to unhook their action or remove their filters, this is quite troublesome. Luckily developers are good at finding loop holes and instead of stealing credit here’s a link to a gist i’ve found most userful.

3 responses to “Remove Action Hooks and Filters defined in classes.”

  1. Ayush Malakar Avatar

    The best tutorial for removing hooks. Thank you for sharing this. Because of this, I don’t have to constantly pull my hair to find a way to remove the hooks.
    Thanks for keeping hair on my head and making sure I’m not going bald ๐Ÿ˜€

    1. Ayush Malakar Avatar

      You should try to use Disqus makes it easier for me to reply again and again. Cheers!! ๐Ÿ˜€

      1. Digamber Pradhan Avatar
        Digamber Pradhan

        I would but discuss is too slow for my liking.
        Speed is important ๐Ÿ˜€

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Filter