[wp-trac] [WordPress Trac] #20929: wp_list_filter Notice

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 18 18:10:30 UTC 2012


#20929: wp_list_filter Notice
------------------------------------------------------+------------------
 Reporter:  wpsmith                                   |       Owner:
     Type:  defect (bug)                              |      Status:  new
 Priority:  normal                                    |   Milestone:  3.5
Component:  Taxonomy                                  |     Version:
 Severity:  normal                                    |  Resolution:
 Keywords:  has-patch needs-refresh needs-unit-tests  |
------------------------------------------------------+------------------
Changes (by nacin):

 * keywords:  has-patch dev-feedback => has-patch needs-refresh needs-unit-
     tests
 * milestone:  Awaiting Review => 3.5


Comment:

 Looks good at a glance. Some thoughts and housekeeping:

  * Let's use array_key_exists() here instead. isset() will return false if
 the value is null, and that may not be expected behavior here.

  * If we had kept isset(), `isset($to_match[ $m_key ]) &&` would be
 `isset( $to_match[ $m_key ] ) &&` per our coding standards.

  * Please diff from the root of WordPress, rather than from within wp-
 includes. This will provide for a patch path of wp-includes/functions.php,
 rather than just functions.php. There happens to be only one functions.php
 file in core (outside of default themes), so when prompted someone
 applying the patch could guess, but there are three post.php files.

  * Some tests here would be cool. They could go into TestListFilter. If
 you run the test suite with the -d flag, it forces WP_DEBUG, and thus you
 can write a test that could normally generate a notice. Be sure to test
 the NULL case :-)

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


More information about the wp-trac mailing list