[wp-trac] [WordPress Trac] #25011: Unnecessary foreach loops in default-filters.php

WordPress Trac noreply at wordpress.org
Sun Aug 11 19:49:26 UTC 2013


#25011: Unnecessary foreach loops in default-filters.php
--------------------------+-----------------------------
 Reporter:  Jayjdk        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  2.2.3
 Severity:  minor         |   Keywords:  has-patch
--------------------------+-----------------------------
 In two cases, defaults-filters.php runs a foreach loop even through
 there's only one item in the array.
 I don't know if it's just me but that seems unnecessary.

 {{{
 // Slugs
 foreach ( array( 'pre_term_slug' ) as $filter ) {
         add_filter( $filter, 'sanitize_title' );
 }

 ...

 // Format for RSS
 foreach ( array( 'term_name_rss' ) as $filter ) {
         add_filter( $filter, 'convert_chars' );
 }
 }}}

 Slugs code introduced in [5937] and the feed code in [5979].
 The code was last changed in [12041].

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


More information about the wp-trac mailing list