Opened 4 years ago
Last modified 4 years ago
#55616 new defect (bug)
Helper function to unhook anonymous class methods
| Reported by: | johnjamesjacoby | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Plugins | Version: | |
| Severity: | normal | Keywords: | 2nd-opinion |
| Cc: | Focuses: |
Description
Problem: it’s pretty common (even if it’s not polite) for plugins to use a class constructor to hook their own public methods into things, but doing so makes it near-impossible to unhook procedurally.
Solution: I just ran across the following function on StackExchange, and imagined something similar could be quite useful to have globally available:
https://wordpress.stackexchange.com/a/304861
It’s gnarly, but it works, and I think having WordPress core include this functionality makes more sense than having plugin authors all include their own version of it.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #23259