[wp-trac] [WordPress Trac] #40156: Warning for invalid hook callback is not very useful
WordPress Trac
noreply at wordpress.org
Tue Mar 14 23:13:23 UTC 2017
#40156: Warning for invalid hook callback is not very useful
-------------------------+------------------------------
Reporter: Shelob9 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 0.71
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by johnbillion):
This is a good suggestion, but I ''think'' the reason the hooks and
filters API doesn't first check the callback function with `is_callable()`
is for performance reasons. Filters can be applied hundreds and even
thousands of times on each page load, so even micro performance is
important.
A good place to start would be to add an `is_callable()` check and then
run some benchmarks to see if it impacts performance.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40156#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list