Documentation / Filters / Remove filters and hooks

Remove filters and hooks

Related Posts for WordPress uses a custom hook/filter system. In the classes directory there is a ‘hooks’ and ‘filters’, these directories contain all hooks and filters of the plugin.

Both hooks and filters have their own manager class that contains a method to get an object reference to each hook or filter it added. Using this reference you can easily remove a previously added hook or filter. To get the object reference simply use the full class name as argument in either ‘get_filter_object’ or ‘get_hook_object’.

Code examples

Remove a filter

Remove a hook