#25367 closed defect (bug) (fixed)
Document WP_Query and related class arguments
Reported by: | DrewAPicture | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Query | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
It's been a long time coming, but here we are.
We've never had a fully documented list of WP_Query
and related class arguments in core docs, however, with the inline docs effort in full swing, and the Code Reference on the way, there's an increasing urgency to have this list in place.
And there's no better time to start than now.
Goals of this ticket:
- Document all accepted
WP_Query
arguments - Document all related class arguments, including:
WP_Tax_Query
argumentsWP_Date_Query
argumentsWP_Meta_Query
arguments
Goals of a future ticket:
- Remove duplicated
WP_Query
argument docs elsewhere in core inline docs. - Back-reference mentions of accepting
WP_Query
parameters to theWP_Query
docs
The attached patch is a relatively complete start to this effort.
Constructive input is welcome and encouraged for hashing out:
- What arguments should or shouldn't be documented
- Descriptions of said arguments in
WP_Query
or related classes - Defaults and Accepted values for said arguments
Let's get to it.
Attachments (2)
Change History (19)
#2
@
11 years ago
+1, this is awesome and will save me a bunch of time documenting it for the REST API. <3
#3
@
11 years ago
Awesome. Nice work!
Here's my feedback on the WP_Date_Query
stuff:
- If we're going to document the class via it's constructor, then it probably makes sense to remove a large portion of the PHPdoc that's at the top of the class. No need to duplicate.
- Probably worth mentioning that the list of acceptable columns is filterable.
- For
before
andafter
, if you're passing an array, then the month and day fields are optional (you don't have to supply all three). Forbefore
it defaults to January and/or the first day of the month and forafter
, it defaults to December and/or the last day of the month. This way you can just say "before 2013" or "before June 2013". - I think we can improve the wording for
inclusive
, but I'm not sure exactly how. - The "accepts" for
$default_column
is missing.
#4
@
11 years ago
I think we're going to need a lot more eyes-on the WP_Query stuff before I'm happy enough to put it in. That said, I'd like to get the WP_Date_Query inline docs in for 3.7, then push the rest down the road.
#6
@
11 years ago
- Milestone changed from 3.7 to 3.8
Moving to 3.8. Let's split out the WP_Date_Query docs as suggested by @johnbillion. I'll make a new ticket.
#8
@
11 years ago
- Milestone changed from 3.8 to Future Release
- Type changed from task (blessed) to defect (bug)
Sad punt face.
#10
follow-up:
↓ 11
@
11 years ago
Patch needs updating to remove WP_Date_Query docs which have been committed via the other ticket.
Worth creating separate tickets for Taxonomy and Meta query docs, and getting them in, rather than trying to do it all under this ticket?
#11
in reply to:
↑ 10
@
11 years ago
Replying to GaryJ:
Patch needs updating to remove WP_Date_Query docs which have been committed via the other ticket.
Worth creating separate tickets for Taxonomy and Meta query docs, and getting them in, rather than trying to do it all under this ticket?
That's fine, though I think I'd rather we/you/they wait to create each ticket until there's a patch to go with it.
#12
@
11 years ago
- Keywords needs-refresh needs-docs added; dev-feedback removed
- Milestone changed from Future Release to 4.0
#13
@
11 years ago
- Keywords needs-refresh needs-docs removed
25367.2.diff refreshes for WP_Query
arguments only.
First-run for
WP_Query
,WP_Tax_Query
,WP_Date_Query
,WP_Meta_Query