WPDev.one
Core Function
View Source on Trac ↗

rest_get_endpoint_args_for_schema()

rest_get_endpoint_args_for_schema( mixed $schema, mixed $method = WP_REST_Server::CREATABLE )

Retrieves an array of endpoint arguments from the item schema and endpoint method.

Parameters 2 required

Name / Type Description
$schema
array

The full JSON schema for the endpoint.

Required
string

$method Optional. HTTP method of the endpoint. The arguments for `CREATABLE` endpoints are checked for required values and may fall-back to a given default, this is not done on `EDITABLE` endpoints. Default WP_REST_Server::CREATABLE.

Required

Return Value

(array)
The endpoint arguments.

Function Information

Since Version
5.6.0
Source File
wp-includes/rest-api.php
Advertisement