Docs: Various docblock improvements.

See #51800


git-svn-id: https://develop.svn.wordpress.org/trunk@49790 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2020-12-10 23:57:29 +00:00
parent 81b89682c3
commit 37f8276a18
11 changed files with 54 additions and 26 deletions

View File

@@ -266,7 +266,15 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
$args['post_type'] = $this->post_type;
/**
* Filters the query arguments for a request.
* Filters WP_Query arguments when querying users via the REST API.
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible filter names include:
*
* - `rest_post_query`
* - `rest_page_query`
* - `rest_attachment_query`
*
* Enables adding extra arguments or setting defaults for a post collection request.
*
@@ -274,8 +282,8 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* @link https://developer.wordpress.org/reference/classes/wp_query/
*
* @param array $args Key value array of query var to query value.
* @param WP_REST_Request $request The request used.
* @param array $args Array of arguments to be passed to WP_Query.
* @param WP_REST_Request $request The REST API request.
*/
$args = apply_filters( "rest_{$this->post_type}_query", $args, $request );
$query_args = $this->prepare_items_query( $args, $request );