WordPress.org

Making WordPress.org

Opened 16 months ago

Last modified 14 months ago

#1913 accepted enhancement

Expand documentation of WP_Term_Query() in Code Reference.

Reported by: kevinwhoffman Owned by: DrewAPicture
Milestone: Priority: normal
Component: Developer Hub Keywords: has-screenshots
Cc:

Description

With the release of 4.6, many devs will be researching WP_Term_Query() only to find that its Code Reference page has very little information. I was expecting documentation similar to WP_Query().

Upon further investigation, I found that much of the information I was looking for is actually in the docs of the WP_Term_Query::__construct() method. I only realized this after reading the DocBlock in the source code, which includes @see WP_Term_Query::__construct() for accepted arguments.. However that info is nowhere to be found in the Code Reference. The the only way to find it is to click __construct() in the Related section.

Can we better reflect the documentation from the __construct() page (specifically the acceptable arguments) in the docs for WP_Term_Query()? This could be accomplished either through examples, or at least a more obvious callout that refers you to the __construct() method for anyone researching how to format the query.

Attachments (1)

1913.png (41.8 KB) - added by keesiemeijer 14 months ago.
simple UI for adding parameters

Download all attachments as: .zip

Change History (7)

#1 @DrewAPicture
16 months ago

  • Owner set to DrewAPicture
  • Status changed from new to accepted

We've been planning to do this (reflect the docs from __construct() and/or other methods on class homepages for all core classes. It's not the same for every class, so we'd probably do well to simply add a simple UI for choosing which method to "feature" for a class reference.

#2 follow-up: @kevinwhoffman
16 months ago

@DrewAPicture You're right this is a larger issue for class home pages. WP_User_Query() is also lacking, but it has a Codex page where at least some examples could be carried over.

#3 in reply to: ↑ 2 @DrewAPicture
16 months ago

Replying to kevinwhoffman:

@DrewAPicture You're right this is a larger issue for class home pages. WP_User_Query() is also lacking, but it has a Codex page where at least some examples could be carried over.

The fact that you can view the article for WP_User_Query in the Codex at all is a prime indication that it hasn't been migrated and redirected yet. Content migration from the Codex is in progress. :-)

This ticket was mentioned in Slack in #meta-devhub by drew. View the logs.


16 months ago

@keesiemeijer
14 months ago

simple UI for adding parameters

#5 @keesiemeijer
14 months ago

Screenshot 1913.png is a simple UI mock-up for adding parameters to Class pages. You can choose from three options:

  • Use parameters from a class method.
  • Use parameters from another post. (Some classes use the parameters from their parent class)
  • Use Text. ( Link to parameters, or explain them )

Your thoughts on this UI are welcome.

#6 @keesiemeijer
14 months ago

  • Keywords has-screenshots added
Note: See TracTickets for help on using tickets.