Docs: Improve documentation of known return types, plus other docs fixes.

See #48303

Built from https://develop.svn.wordpress.org/trunk@46660


git-svn-id: http://core.svn.wordpress.org/trunk@46460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn
2019-11-05 21:23:02 +00:00
parent f9e81c83d5
commit f545bb3f63
32 changed files with 178 additions and 120 deletions

View File

@@ -330,7 +330,7 @@ class WP_REST_Request implements ArrayAccess {
*
* @since 4.4.0
*
* @return array List of types to check, in order of priority.
* @return string[] Array of types to check, in order of priority.
*/
protected function get_parameter_order() {
$order = array();
@@ -366,12 +366,8 @@ class WP_REST_Request implements ArrayAccess {
*
* @since 4.4.0
*
* @param array $order {
* An array of types to check, in order of priority.
*
* @param string $type The type to check.
* }
* @param WP_REST_Request $this The request object.
* @param string[] $order Array of types to check, in order of priority.
* @param WP_REST_Request $this The request object.
*/
return apply_filters( 'rest_request_parameter_order', $order, $this );
}

View File

@@ -780,7 +780,7 @@ class WP_REST_Server {
*
* @since 4.4.0
*
* @return array List of registered namespaces.
* @return string[] List of registered namespaces.
*/
public function get_namespaces() {
return array_keys( $this->namespaces );
@@ -1017,7 +1017,7 @@ class WP_REST_Server {
*
* @type string $context Context.
* }
* @return array Index entity
* @return WP_REST_Response The API root index data.
*/
public function get_index( $request ) {
// General site data.
@@ -1100,7 +1100,7 @@ class WP_REST_Server {
*
* @param array $routes Routes to get data for.
* @param string $context Optional. Context for data. Accepts 'view' or 'help'. Default 'view'.
* @return array Route data to expose in indexes.
* @return array[] Route data to expose in indexes, keyed by route.
*/
public function get_data_for_routes( $routes, $context = 'view' ) {
$available = array();
@@ -1131,8 +1131,8 @@ class WP_REST_Server {
*
* @since 4.4.0
*
* @param array $available Map of route to route data.
* @param array $routes Internal route data as an associative array.
* @param array[] $available Route data to expose in indexes, keyed by route.
* @param array $routes Internal route data as an associative array.
*/
return apply_filters( 'rest_route_data', $available, $routes );
}