[wp-trac] [WordPress Trac] #5317: get_posts returns invalid data when using category= parameter

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 4 13:44:12 GMT 2007


#5317: get_posts returns invalid data when using category= parameter
----------------------+-----------------------------------------------------
 Reporter:  MichaelH  |       Owner:  anonymous
     Type:  defect    |      Status:  new      
 Priority:  normal    |   Milestone:  2.4      
Component:  General   |     Version:  2.3.1    
 Severity:  normal    |    Keywords:           
----------------------+-----------------------------------------------------
 Take a new 2.3.1 install with this code:

 {{{$myposts = get_posts('category=2');}}}

 You would expect to get NO results, as an out-of-the-box install has no
 posts with category 2, but that code will return the "Hello World!" post.

 Guessing this might be caused by get_posts not discerning between post
 categories and link categories (e.g. the link with link_id=1 in category 2
 causes post with ID=1 to be returned).

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


More information about the wp-trac mailing list