Opened 3 years ago
Last modified 3 years ago
#55616 new defect (bug)
Helper function to unhook anonymous class methods
Reported by: | johnjamesjacoby | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | 2nd-opinion |
Focuses: | Cc: |
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.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Related: #23259