Make WordPress Core

Opened 8 years ago

Last modified 6 years ago

#38283 new defect (bug)

Some `WP_Query` query vars undocumented

Reported by: jdgrimes's profile jdgrimes Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch needs-refresh
Focuses: docs Cc:

Description

While working on #38276, I noticed that the has_password and post_password query args (added in [27395]) aren't included in the inline docs for WP_Query::parse_query() with the other args. I did a search for all of the args used in WP_Query, and discovered that the following args are used but not documented:

attachment
caller_get_posts
embed
error
feed
has_password
minute
post_password
posts_per_rss
preview
robots
search_orderby_title
search_terms
search_terms_count
showposts
static
subpost
subpost_id
taxonomy
tb
term
term_id
withcomments
withoutcomments

Some of these may be deprecated, discouraged, or internal. If there has been a previous decision not to include them for some reason, then I apologize for bringing it up. But I couldn't find any tickets relating to the password related args not being documented, so I have a feeling that some of these may have just been overlooked.

Perhaps some of these shouldn't be documented, although we could document deprecated args and that they are deprecated, rather than just leaving them out. But at least this ticket will provide us a central place where we can state why certain ones aren't going to be documented, if indeed that's the decision.

Attachments (1)

38283.patch (5.5 KB) - added by milana_cap 7 years ago.
Far from finished but it's a start.

Download all attachments as: .zip

Change History (5)

#1 @jdgrimes
8 years ago

  • Summary changed from Document missing `WP_Query` query vars to Some `WP_Query` query vars undocumented

#2 @boonebgorges
8 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Hi @jdgrimes - Based on the internal logic of WP_Query - I haven't yet dug into the changelogs - at least some of these params are, as you suggest, deprecated. 'subpost', 'subpost_id', and 'caller_get_posts' are the three I noticed on a quick search. I don't think we want these documented as accepted parameters.

Those params that are currently in use - like 'attachment' and 'embed', among (I'm sure) many others on your list - should probably get documentation.

So, anyone who wants to tackle this issue will have to look at each param on a case-by-case basis.

#3 @swissspidy
8 years ago

  • Version 4.7 deleted

@milana_cap
7 years ago

Far from finished but it's a start.

#4 @desrosj
6 years ago

  • Keywords has-patch needs-refresh added; needs-patch removed
Note: See TracTickets for help on using tickets.