[wp-trac] [WordPress Trac] #27193: tax_query returns only partial results

WordPress Trac noreply at wordpress.org
Mon Mar 31 18:45:31 UTC 2014


#27193: tax_query returns only partial results
--------------------------+-----------------------
 Reporter:  p_enrique     |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Query         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------
Changes (by p_enrique):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Replying to [comment:2 johnbillion]:
 > The problem here is being caused by your call to `$query->get_posts()`.
 > See the [http://codex.wordpress.org/Class_Reference/WP_Query#Usage Usage
 section of WP_Query] for the correct usage.

 Thanks for the reply. I'd like to point out that
 1. the referred Usage section only describes using the `WP_Query` inside
 "the Loop",
 2. [http://codex.wordpress.org/Class_Reference/WP_Query#Methods just below
 on the same page] the `get_posts()` method is said to "[f]etch and return
 the requested posts from the database", and
 3. the docblock in `/wp-includes/query.php` describes the functionality of
 the `get_posts()` method as "Retrieve the posts based on query variables"
 and defines "@return array List of posts" and "@access public".

 Based on the above, I'd say that in this case the `get_posts()` method
 isn't doing what it's supposed to do according to the available docs. I'm
 going to dare to reopen this ticket and hope that some diagnoses whether
 this is actually a documentation problem or a code problem and attaches
 the appropriate keywords to this ticket.

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


More information about the wp-trac mailing list