[wp-trac] [WordPress Trac] #28496: get_posts ignoring 'category' parameter

WordPress Trac noreply at wordpress.org
Tue Jun 10 12:03:43 UTC 2014


#28496: get_posts ignoring 'category' parameter
-------------------------------+------------------------------
 Reporter:  Ton_y              |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  3.9.1
 Severity:  major              |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by engelen):

 * keywords:   => reporter-feedback


Comment:

 I am unable to reproduce this with a clean WordPress 3.9.1 install,
 running PHP 5.4.19. I've simply added two posts, of which I placed one in
 a newly created category (with ID). Then, I ran
 {{{
 $posts = get_posts( array(
         'posts_per_page' => -1,
         'category' => 2
 ) );
 }}}
 on the `init` action, after which `$posts` contained the single post in
 category 2.

 Could you provide a way to reproduce the issue you're encountering?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28496#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list