[wp-trac] [WordPress Trac] #12966: get_post_types returning more than desired results

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 12 21:21:50 UTC 2010


#12966: get_post_types returning more than desired results
--------------------------+-------------------------------------------------
 Reporter:  michaelh      |       Owner:           
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  3.0      
Component:  Template      |     Version:  3.0      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by scribu):

 So, 12966.3.diff:

 - adds an empty($args) check to prevent the warning mentioned by michaelh
 above.

 - adds the $operator argument to wp_filter_object_list(), get_post_types()
 and get_taxonomies()

 - refactors get_post_stati() to use wp_filter_object_list()

 Seeing that get_post_stati() was only introduced in 3.0, I took the
 liberty of switching the default value for the $operator argument from
 'or' to 'and'. This makes it consistent with get_post_types() and
 get_taxonomies() and it's also the more common use-case.

 I've double-checked that this change doesn't affect it's usage in core.

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


More information about the wp-trac mailing list