[wp-trac] [WordPress Trac] #44630: WP_Term_Query does not return all terms when 'number' and 'object_ids' are specified

WordPress Trac noreply at wordpress.org
Tue Jul 24 09:03:10 UTC 2018


#44630: WP_Term_Query does not return all terms when 'number' and 'object_ids' are
specified
--------------------------+-----------------------------
 Reporter:  ettoredn      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  trunk
 Severity:  critical      |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When querying for taxonomy terms assigned to certain objects,
 WP_Term_Query's query is LIMIT'ed if the 'number' argument is specified.
 This introduces a problem similar to hierarchical taxonomies where results
 must not be limited in order to retrieve children. In particular, the
 issue arises because each term_taxonomy_id, or "(term, taxonomy) couple",
 has more than one relationship in wp_term_relationships thus more than 1
 row could be returned for the same term_taxonomy_id.

 It is worth to notice that in order to replicate the problem in the
 attached test, the 'order' argument must be set to DESC which is the
 opposite of WP_Term_Query's default.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44630>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list