Allow filtering the $function parameter of add_filter(), has_filter() and remove_filter()
|Reported by:||MikeSchinkel||Owned by:|
In a comment made by someone on a recent blog post of mine entitled "Enabling Action and Filter Hook Removal from Class-based WordPress Plugins" the commenter lamented on the complexity of removing hooks when plugin developers use classes.
Plugin developers who use classes use so many different architectures; i.e. some use static methods, others using instance methods with singletons, other's use class factories, etc. If WordPress were to allow plugin developers to filter the $function value passed to the _wp_filter_build_unique_id() function then our plugins could mask much of the complexity required for the site builder to interact with our plugins. I could for example support the following syntax even though I'm really might be using a Singleton:
remove_action( 'the_content', 'My_Plugin_Main_Class::the_content' );
Of even the following so the site builder doesn't have to know all about my class hierarchy:
remove_action( 'the_content', 'My_Plugin::the_content' );
Then it would just be up to the plugin developer to add some simple documentation to their plugin's README file.
Change History (16)
in reply to:
4 years ago
- Cc mike@… added
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed