herewithme / wp-filters-extras

Add 2 methods for WP Filter API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WordPress 4.7+ support

tripflex opened this issue · comments

FYI this will break in WordPress 4.7:
https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/

I wrote one a while back, and i've updated my gist to work with 4.7+ and still maintain backwards compatibility:
https://gist.github.com/tripflex/c6518efc1753cf2392559866b4bd1a53

Another good (and maybe simpler) way to do the same thing is shown and explained here:

http://wordpress.stackexchange.com/questions/57079/how-to-remove-a-filter-that-is-an-anonymous-object#57088

It uses the name created by _wp_filter_build_unique_id() along with the built-in remove_filter function.