[wp-trac] [WordPress Trac] #21321: Remove is_null() checks in apply_filters(), do_action(), et al.

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 20 04:55:30 UTC 2012


#21321: Remove is_null() checks in apply_filters(), do_action(), et al.
-------------------------+-----------------
 Reporter:  nacin        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  3.5
Component:  Performance  |    Version:
 Severity:  normal       |   Keywords:
-------------------------+-----------------
 In apply_filters(), do_action(), and friends, there is a check for `!
 is_null( $the['function'] )`. As these functions get called collectively
 thousands of times per page, a tiny check like this can add up.

 A few months ago, I decided to track it down. They were shuffled around a
 bit in [4955], but they actually had roots in [1394]. The link there
 (http://www.kackreiz.net/wordpress.php) is dead, but I found it at
 http://www.kackreiz.net/wordpress/apply_filters.html#fixed, via
 http://wordpress.org/support/topic/bug-in-
 remove_filterapply_filters?replies=3.

 The original bug was that remove_filter() left NULL's in the $wp_filter
 array, rather than properly unsetting it as it was modified to do long
 ago. Now that we no longer leave NULL scattered about, this check is safe
 to remove.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21321>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list