[wp-trac] [WordPress Trac] #15296: Filters don't check that the function is callable

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 2 18:34:23 UTC 2010


#15296: Filters don't check that the function is callable
---------------------------+------------------------------------------------
 Reporter:  aaroncampbell  |       Owner:                 
     Type:  defect (bug)   |      Status:  new            
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Performance    |     Version:  3.0            
 Severity:  normal         |    Keywords:  dev-feedback   
---------------------------+------------------------------------------------

Comment(by nacin):

 Argument for:

  - Prevents silent failures by skipping the filter.

  - We code defensively for plugins in many other places.

 Arguments against:

  - Speed. We need these functions to be fast as possible.

  - The callback may not be available on add_filter, and apply_filters runs
 1500 times on a typical pageload. (300 times for add_filter -- per westi
 in IRC.)

  - Silent failures do not help plugin authors.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15296#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list