[wp-trac] [WordPress Trac] #21267: Kill the serialization of $wp_filter in get_terms()

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 6 00:35:38 UTC 2012


#21267: Kill the serialization of $wp_filter in get_terms()
--------------------------+------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.5
Component:  Cache         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by wonderboymusic):

 * keywords:  needs-patch => has-patch


Comment:

 Attached the patch:

 Removed the unreachable code[[BR]]
 Created a function to hash a closure: {{{_wp_build_unique_closure_id(
 $function )}}} [[BR]]
 Created a function to hash a list of callbacks by key:
 {{{wp_filter_callbacks_hash( $tag )}}}[[BR]]

 {{{_wp_filter_build_unique_id()}}} now generally returns the string name
 of a function or class ('MyClass::method') which is what this function was
 doing anyways - it returns an md5 string representing a closure where
 applicable

 {{{get_terms()}}} now internally calls:
 {{{
 $filter_key = wp_filter_callbacks_hash( 'list_terms_exclusions' );
 }}}

 It previously called:
 {{{
 $filter_key = ( has_filter('list_terms_exclusions') ) ?
 serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
 }}}

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


More information about the wp-trac mailing list