Opened 6 years ago
Closed 4 years ago
#44443 closed defect (bug) (fixed)
Confusing Documentation in WP_Term_Query::__construct()
Reported by: | jeremyescott | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Query | Keywords: | has-patch dev-feedback |
Focuses: | docs | Cc: |
Description
So I'm working on a pesky issue around a get_terms() call that, of course, uses WP_Term_Query::construct() and, while I fixed the issue (it was my fault) I spent some time in docs and in fact I got quite confused by an aspect of documentation, which I fully believe is an error.
from wp-includes/class-wp-term-query.php: 99
/* [...] * @type string $orderby Field(s) to order terms by. Accepts term fields ('name', * 'slug', 'term_group', 'term_id', 'id', 'description', 'parent'), * 'count' for term taxonomy count, 'include' to match the * 'order' of the $include param, 'slug__in' to match the * 'order' of the $slug param, 'meta_value', 'meta_value_num', * the value of `$meta_key`, the array keys of `$meta_query`, or * 'none' to omit the ORDER BY clause. Defaults to 'name'. * [...] */
My problem is with this bit:
'count' for term taxonomy count,
A term doesn't have taxonomy, right? A taxonomy has terms, but not terms taxonomy. I personally believe this should read (because it matches behavior):
'count' for number of posts in term count
Or something like that.
Is this correct? I don't think I'm crazy, but I'd love a second opinion. If I get some agreement, I'll either happily write a patch or let this one be a "good-first-patch" for a newbie!
Attachments (1)
Change History (10)
#3
@
6 years ago
Hi welcome to Trac and thanks for the ticket.
Yes, taxonomy has terms, not the other way round!
So I think it could be reworded like this:
... * 'count' for taxonomy term count ...
#5
@
6 years ago
- Keywords dev-feedback added
- Summary changed from WP_Term_Query::__construct() to Confusing Documentation in WP_Term_Query::__construct()
I'm so sorry! What a terrible title. I read and re-read the post content and didn't write a proper title.