Docs: Remove @access notations from method DocBlocks in wp-includes/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs. See #41452. Built from https://develop.svn.wordpress.org/trunk@41162 git-svn-id: http://core.svn.wordpress.org/trunk@41002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -32,7 +32,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* HTTP method.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $method = '';
|
||||
@@ -44,7 +43,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* superglobals when being created from the global scope.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array Contains GET, POST and FILES keys mapping to arrays of data.
|
||||
*/
|
||||
protected $params;
|
||||
@@ -53,7 +51,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* HTTP headers for the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array Map of key to value. Key is always lowercase, as per HTTP specification.
|
||||
*/
|
||||
protected $headers = array();
|
||||
@@ -62,7 +59,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Body data.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var string Binary data from the request.
|
||||
*/
|
||||
protected $body = null;
|
||||
@@ -71,7 +67,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Route matched for the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $route;
|
||||
@@ -83,7 +78,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* containing the callback as well as the valid methods for the route.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array Attributes for the request.
|
||||
*/
|
||||
protected $attributes = array();
|
||||
@@ -94,7 +88,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Allows lazy-parsing of JSON data where possible.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var bool
|
||||
*/
|
||||
protected $parsed_json = false;
|
||||
@@ -103,7 +96,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Used to determine if the body data has been parsed yet.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var bool
|
||||
*/
|
||||
protected $parsed_body = false;
|
||||
@@ -112,7 +104,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $method Optional. Request method. Default empty.
|
||||
* @param string $route Optional. Request route. Default empty.
|
||||
@@ -140,7 +131,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves the HTTP method for the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return string HTTP method.
|
||||
*/
|
||||
@@ -152,7 +142,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets HTTP method for the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $method HTTP method.
|
||||
*/
|
||||
@@ -164,7 +153,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves all headers from the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Map of key to value. Key is always lowercase, as per HTTP specification.
|
||||
*/
|
||||
@@ -186,7 +174,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* @link https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
* @static
|
||||
*
|
||||
* @param string $key Header name.
|
||||
@@ -207,7 +194,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* (notably cookie headers) cannot be joined this way.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header name, will be canonicalized to lowercase.
|
||||
* @return string|null String value if set, null otherwise.
|
||||
@@ -226,7 +212,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves header values from the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header name, will be canonicalized to lowercase.
|
||||
* @return array|null List of string values if set, null otherwise.
|
||||
@@ -245,7 +230,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets the header on request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header name.
|
||||
* @param string $value Header value, or list of values.
|
||||
@@ -261,7 +245,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Appends a header value for the given header.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header name.
|
||||
* @param string $value Header value, or list of values.
|
||||
@@ -281,7 +264,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Removes all values for a header.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header name.
|
||||
*/
|
||||
@@ -294,7 +276,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets headers on the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $headers Map of header name to value.
|
||||
* @param bool $override If true, replace the request's headers. Otherwise, merge with existing.
|
||||
@@ -313,7 +294,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves the content-type of the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Map containing 'value' and 'parameters' keys.
|
||||
*/
|
||||
@@ -348,7 +328,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Used when checking parameters in get_param().
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array List of types to check, in order of priority.
|
||||
*/
|
||||
@@ -400,7 +379,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves a parameter from the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Parameter name.
|
||||
* @return mixed|null Value if set, null otherwise.
|
||||
@@ -422,7 +400,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets a parameter on the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Parameter name.
|
||||
* @param mixed $value Parameter value.
|
||||
@@ -439,7 +416,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Handles merging all the available values into a single array.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Map of key to value.
|
||||
*/
|
||||
@@ -465,7 +441,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are parsed from the URL using the regex.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Parameter map of key to value.
|
||||
*/
|
||||
@@ -479,7 +454,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Typically, this is set after parsing the URL.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $params Parameter map of key to value.
|
||||
*/
|
||||
@@ -493,7 +467,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are the parameters you'd typically find in `$_GET`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Parameter map of key to value
|
||||
*/
|
||||
@@ -507,7 +480,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Typically, this is set from `$_GET`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $params Parameter map of key to value.
|
||||
*/
|
||||
@@ -521,7 +493,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are the parameters you'd typically find in `$_POST`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Parameter map of key to value.
|
||||
*/
|
||||
@@ -535,7 +506,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Typically, this is set from `$_POST`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $params Parameter map of key to value.
|
||||
*/
|
||||
@@ -549,7 +519,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are the parameters you'd typically find in `$_FILES`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Parameter map of key to value
|
||||
*/
|
||||
@@ -563,7 +532,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Typically, this is set from `$_FILES`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $params Parameter map of key to value.
|
||||
*/
|
||||
@@ -577,7 +545,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are the parameters set in the route registration.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Parameter map of key to value
|
||||
*/
|
||||
@@ -591,7 +558,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are the parameters set in the route registration.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $params Parameter map of key to value.
|
||||
*/
|
||||
@@ -603,7 +569,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves the request body content.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Binary data from the request body.
|
||||
*/
|
||||
@@ -615,7 +580,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets body content.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $data Binary data from the request body.
|
||||
*/
|
||||
@@ -632,7 +596,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves the parameters from a JSON-formatted body.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Parameter map of key to value.
|
||||
*/
|
||||
@@ -650,7 +613,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @since 4.7.0 Returns error instance if value cannot be decoded.
|
||||
* @access protected
|
||||
* @return true|WP_Error True if the JSON data was passed or no JSON data was provided, WP_Error if invalid JSON was passed.
|
||||
*/
|
||||
protected function parse_json_params() {
|
||||
@@ -706,7 +668,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* natively by PHP. In PHP 5.x, only POST has these parsed automatically.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*/
|
||||
protected function parse_body_params() {
|
||||
if ( $this->parsed_body ) {
|
||||
@@ -747,7 +708,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves the route that matched the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Route matching regex.
|
||||
*/
|
||||
@@ -759,7 +719,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets the route that matched the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $route Route matching regex.
|
||||
*/
|
||||
@@ -773,7 +732,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* These are the options for the route that was matched.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Attributes for the request.
|
||||
*/
|
||||
@@ -785,7 +743,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets the attributes for the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $attributes Attributes for the request.
|
||||
*/
|
||||
@@ -800,7 +757,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* argument.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return true|WP_Error True if parameters were sanitized, WP_Error if an error occurred during sanitization.
|
||||
*/
|
||||
@@ -856,7 +812,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Checks whether this request is valid according to its attributes.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return bool|WP_Error True if there are no parameters to validate or if all pass validation,
|
||||
* WP_Error if required parameters are missing.
|
||||
@@ -924,7 +879,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Checks if a parameter is set.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $offset Parameter name.
|
||||
* @return bool Whether the parameter is set.
|
||||
@@ -945,7 +899,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Retrieves a parameter from the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $offset Parameter name.
|
||||
* @return mixed|null Value if set, null otherwise.
|
||||
@@ -958,7 +911,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Sets a parameter on the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $offset Parameter name.
|
||||
* @param mixed $value Parameter value.
|
||||
@@ -971,7 +923,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
* Removes a parameter from the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $offset Parameter name.
|
||||
*/
|
||||
@@ -989,7 +940,6 @@ class WP_REST_Request implements ArrayAccess {
|
||||
*
|
||||
* @static
|
||||
* @since 4.5.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $url URL with protocol, domain, path and query args.
|
||||
* @return WP_REST_Request|false WP_REST_Request object on success, false on failure.
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Links related to the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $links = array();
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* The route that was to create the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $matched_route = '';
|
||||
@@ -38,7 +36,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* The handler that was used to create the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var null|array
|
||||
*/
|
||||
protected $matched_handler = null;
|
||||
@@ -49,7 +46,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* @internal The $rel parameter is first, as this looks nicer when sending multiple.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc5988
|
||||
* @link https://www.iana.org/assignments/link-relations/link-relations.xml
|
||||
@@ -79,7 +75,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Removes a link from the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $rel Link relation. Either an IANA registered type, or an absolute URL.
|
||||
* @param string $href Optional. Only remove links for the relation matching the given href.
|
||||
@@ -110,7 +105,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* associative arrays.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $links Map of link relation to list of links.
|
||||
*/
|
||||
@@ -131,7 +125,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Retrieves links for the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array List of links.
|
||||
*/
|
||||
@@ -145,7 +138,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* @internal The $rel parameter is first, as this looks nicer when sending multiple.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc5988
|
||||
* @link https://www.iana.org/assignments/link-relations/link-relations.xml
|
||||
@@ -171,7 +163,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Retrieves the route that was used.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return string The matched route.
|
||||
*/
|
||||
@@ -183,7 +174,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Sets the route (regex for path) that caused the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $route Route name.
|
||||
*/
|
||||
@@ -195,7 +185,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Retrieves the handler that was used to generate the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return null|array The handler that was used to create the response.
|
||||
*/
|
||||
@@ -207,7 +196,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Retrieves the handler that was responsible for generating the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $handler The matched handler.
|
||||
*/
|
||||
@@ -219,7 +207,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Checks if the response is an error, i.e. >= 400 response code.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return bool Whether the response is an error.
|
||||
*/
|
||||
@@ -231,7 +218,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Retrieves a WP_Error object from the response.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return WP_Error|null WP_Error or null on not an errored response.
|
||||
*/
|
||||
@@ -261,7 +247,6 @@ class WP_REST_Response extends WP_HTTP_Response {
|
||||
* Retrieves the CURIEs (compact URIs) used for relations.
|
||||
*
|
||||
* @since 4.5.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Compact URIs.
|
||||
*/
|
||||
|
||||
@@ -58,7 +58,6 @@ class WP_REST_Server {
|
||||
* Namespaces registered to the server.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $namespaces = array();
|
||||
@@ -67,7 +66,6 @@ class WP_REST_Server {
|
||||
* Endpoints registered to the server.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $endpoints = array();
|
||||
@@ -76,7 +74,6 @@ class WP_REST_Server {
|
||||
* Options defined for the routes.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $route_options = array();
|
||||
@@ -85,7 +82,6 @@ class WP_REST_Server {
|
||||
* Instantiates the REST server.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->endpoints = array(
|
||||
@@ -107,7 +103,6 @@ class WP_REST_Server {
|
||||
* Checks the authentication headers if supplied.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return WP_Error|null WP_Error indicates unsuccessful login, null indicates successful
|
||||
* or no authentication provided
|
||||
@@ -148,7 +143,6 @@ class WP_REST_Server {
|
||||
* list in JSON rather than an object/map.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_Error $error WP_Error instance.
|
||||
* @return WP_REST_Response List of associative arrays with code and message keys.
|
||||
@@ -191,7 +185,6 @@ class WP_REST_Server {
|
||||
* a 'status' key, with the value being the HTTP status to send.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $code WP_Error-style code.
|
||||
* @param string $message Human-readable message.
|
||||
@@ -215,7 +208,6 @@ class WP_REST_Server {
|
||||
* callback then outputs a JSON representation of the returned value.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @see WP_REST_Server::dispatch()
|
||||
*
|
||||
@@ -425,7 +417,6 @@ class WP_REST_Server {
|
||||
* Converts a response to data to send.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Response $response Response object.
|
||||
* @param bool $embed Whether links should be embedded.
|
||||
@@ -463,7 +454,6 @@ class WP_REST_Server {
|
||||
* direct output.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
* @static
|
||||
*
|
||||
* @param WP_REST_Response $response Response to extract links from.
|
||||
@@ -497,7 +487,6 @@ class WP_REST_Server {
|
||||
* direct output.
|
||||
*
|
||||
* @since 4.5.0
|
||||
* @access public
|
||||
* @static
|
||||
*
|
||||
* @param WP_REST_Response $response Response to extract links from.
|
||||
@@ -547,7 +536,6 @@ class WP_REST_Server {
|
||||
* Embeds the links from the data into the request.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $data Data from the request.
|
||||
* @return array {
|
||||
@@ -623,7 +611,6 @@ class WP_REST_Server {
|
||||
* data instead.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Response $response Response object.
|
||||
* @param bool $embed Whether links should be embedded.
|
||||
@@ -654,7 +641,6 @@ class WP_REST_Server {
|
||||
* Registers a route to the server.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $namespace Namespace.
|
||||
* @param string $route The REST route.
|
||||
@@ -709,7 +695,6 @@ class WP_REST_Server {
|
||||
* used as the delimiter with preg_match()
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array `'/path/regex' => array( $callback, $bitmask )` or
|
||||
* `'/path/regex' => array( array( $callback, $bitmask ), ...)`.
|
||||
@@ -784,7 +769,6 @@ class WP_REST_Server {
|
||||
* Retrieves namespaces registered on the server.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @return array List of registered namespaces.
|
||||
*/
|
||||
@@ -796,7 +780,6 @@ class WP_REST_Server {
|
||||
* Retrieves specified options for a route.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $route Route pattern to fetch options for.
|
||||
* @return array|null Data as an associative array if found, or null if not found.
|
||||
@@ -813,7 +796,6 @@ class WP_REST_Server {
|
||||
* Matches the request to a callback and call it.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Request to attempt dispatching.
|
||||
* @return WP_REST_Response Response returned by the callback.
|
||||
@@ -993,7 +975,6 @@ class WP_REST_Server {
|
||||
* "Encoding error: Maximum stack depth exceeded".
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*
|
||||
* @return bool|string Boolean false or string error message.
|
||||
*/
|
||||
@@ -1018,7 +999,6 @@ class WP_REST_Server {
|
||||
* This endpoint describes the capabilities of the site.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $request {
|
||||
* Request.
|
||||
@@ -1063,7 +1043,6 @@ class WP_REST_Server {
|
||||
* Retrieves the index for a namespace.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request REST request instance.
|
||||
* @return WP_REST_Response|WP_Error WP_REST_Response instance if the index was found,
|
||||
@@ -1106,7 +1085,6 @@ class WP_REST_Server {
|
||||
* Retrieves the publicly-visible data for routes.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $routes Routes to get data for.
|
||||
* @param string $context Optional. Context for data. Accepts 'view' or 'help'. Default 'view'.
|
||||
@@ -1151,7 +1129,6 @@ class WP_REST_Server {
|
||||
* Retrieves publicly-visible data for the route.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $route Route to get data for.
|
||||
* @param array $callbacks Callbacks to convert to data.
|
||||
@@ -1237,7 +1214,6 @@ class WP_REST_Server {
|
||||
* Sends an HTTP status code.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $code HTTP status.
|
||||
*/
|
||||
@@ -1249,7 +1225,6 @@ class WP_REST_Server {
|
||||
* Sends an HTTP header.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header key.
|
||||
* @param string $value Header value.
|
||||
@@ -1270,7 +1245,6 @@ class WP_REST_Server {
|
||||
* Sends multiple HTTP headers.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $headers Map of header name to header value.
|
||||
*/
|
||||
@@ -1284,7 +1258,6 @@ class WP_REST_Server {
|
||||
* Removes an HTTP header from the current response.
|
||||
*
|
||||
* @since 4.8.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key Header key.
|
||||
*/
|
||||
@@ -1308,7 +1281,6 @@ class WP_REST_Server {
|
||||
* Retrieves the raw request entity (body).
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @global string $HTTP_RAW_POST_DATA Raw post data.
|
||||
*
|
||||
@@ -1332,7 +1304,6 @@ class WP_REST_Server {
|
||||
* Extracts headers from a PHP-style $_SERVER array.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $server Associative array similar to `$_SERVER`.
|
||||
* @return array Headers extracted from the input.
|
||||
|
||||
@@ -21,7 +21,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* prepares for WP_Query.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $prepared_args Optional. Array of prepared arguments. Default empty array.
|
||||
* @param WP_REST_Request $request Optional. Request to prepare items for.
|
||||
@@ -59,7 +58,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Checks if a given request has access to create an attachment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|true Boolean true if the attachment may be created, or a WP_Error if not.
|
||||
@@ -92,7 +90,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Creates a single attachment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, WP_Error object on failure.
|
||||
@@ -200,7 +197,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Updates a single attachment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, WP_Error object on failure.
|
||||
@@ -245,7 +241,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Prepares a single attachment for create or update.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_Error|stdClass $prepared_attachment Post object.
|
||||
@@ -282,7 +277,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Prepares a single attachment output for response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_Post $post Attachment object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -375,7 +369,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Retrieves the attachment's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema as an array.
|
||||
*/
|
||||
@@ -481,7 +474,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Handles an upload via raw POST data.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $data Supplied file data.
|
||||
* @param array $headers HTTP headers from the request.
|
||||
@@ -579,7 +571,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* ext-token = <the characters in token, followed by "*">
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @link http://tools.ietf.org/html/rfc2388
|
||||
* @link http://tools.ietf.org/html/rfc6266
|
||||
@@ -632,7 +623,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Retrieves the query params for collections of attachments.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Query parameters for the attachment collection as an array.
|
||||
*/
|
||||
@@ -662,7 +652,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Validates whether the user can query private statuses.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value Status value.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -681,7 +670,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Handles an upload via multipart/form-data ($_FILES).
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $files Data from the `$_FILES` superglobal.
|
||||
* @param array $headers HTTP headers from the request.
|
||||
@@ -731,7 +719,6 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
||||
* Media types are considered the MIME type category.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array Array of supported media types.
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Instance of a comment meta fields object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var WP_REST_Comment_Meta_Fields
|
||||
*/
|
||||
protected $meta;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'wp/v2';
|
||||
@@ -42,7 +40,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function register_routes() {
|
||||
|
||||
@@ -111,7 +108,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read comments.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has read access, error object otherwise.
|
||||
@@ -164,7 +160,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Retrieves a list of comment items.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or error object on failure.
|
||||
@@ -339,7 +334,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read the comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has read access for the item, error object otherwise.
|
||||
@@ -371,7 +365,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Retrieves a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or error object on failure.
|
||||
@@ -392,7 +385,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to create a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has access to create items, error object otherwise.
|
||||
@@ -480,7 +472,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Creates a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or error object on failure.
|
||||
@@ -648,7 +639,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if a given REST request has access to update a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has access to update the item, error object otherwise.
|
||||
@@ -670,7 +660,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Updates a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or error object on failure.
|
||||
@@ -767,7 +756,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to delete a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has access to delete the item, error object otherwise.
|
||||
@@ -788,7 +776,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Deletes a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or error object on failure.
|
||||
@@ -857,7 +844,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Prepares a single comment output for response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_Comment $comment Comment object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -923,7 +909,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Prepares links for the request.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_Comment $comment Comment object.
|
||||
* @return array Links for the given comment.
|
||||
@@ -992,7 +977,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Prepends internal property prefix to query parameters to match our response fields.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $query_param Query parameter.
|
||||
* @return string The normalized query parameter.
|
||||
@@ -1025,7 +1009,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks comment_approved to set comment status for single comment output.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string|int $comment_approved comment status.
|
||||
* @return string Comment status.
|
||||
@@ -1057,7 +1040,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Prepares a single comment to be inserted into the database.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return array|WP_Error Prepared comment, otherwise WP_Error object.
|
||||
@@ -1153,7 +1135,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Retrieves the comment's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -1313,7 +1294,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Comments collection parameters.
|
||||
*/
|
||||
@@ -1471,7 +1451,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Sets the comment_status of a given comment object when creating or updating a comment.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string|int $new_status New comment status.
|
||||
* @param int $comment_id Comment ID.
|
||||
@@ -1520,7 +1499,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Correctly handles posts with the inherit status.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
* @param WP_REST_Request $request Request data to check.
|
||||
@@ -1558,7 +1536,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if the comment can be read.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_Comment $comment Comment object.
|
||||
* @param WP_REST_Request $request Request data to check.
|
||||
@@ -1593,7 +1570,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* Checks if a comment can be edited or deleted.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $comment Comment object.
|
||||
* @return bool Whether the comment can be edited or deleted.
|
||||
@@ -1618,7 +1594,6 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* string is allowed when a comment is being updated.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $value Author email value submitted.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
|
||||
@@ -18,7 +18,6 @@ abstract class WP_REST_Controller {
|
||||
* The namespace of this controller's route.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace;
|
||||
@@ -27,7 +26,6 @@ abstract class WP_REST_Controller {
|
||||
* The base of this controller's route.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $rest_base;
|
||||
@@ -36,7 +34,6 @@ abstract class WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function register_routes() {
|
||||
_doing_it_wrong( 'WP_REST_Controller::register_routes', __( 'The register_routes() method must be overridden' ), '4.7' );
|
||||
@@ -46,7 +43,6 @@ abstract class WP_REST_Controller {
|
||||
* Checks if a given request has access to get items.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
|
||||
@@ -59,7 +55,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves a collection of items.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -72,7 +67,6 @@ abstract class WP_REST_Controller {
|
||||
* Checks if a given request has access to get a specific item.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.
|
||||
@@ -85,7 +79,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves one item from the collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -98,7 +91,6 @@ abstract class WP_REST_Controller {
|
||||
* Checks if a given request has access to create items.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|bool True if the request has access to create items, WP_Error object otherwise.
|
||||
@@ -111,7 +103,6 @@ abstract class WP_REST_Controller {
|
||||
* Creates one item from the collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -124,7 +115,6 @@ abstract class WP_REST_Controller {
|
||||
* Checks if a given request has access to update a specific item.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|bool True if the request has access to update the item, WP_Error object otherwise.
|
||||
@@ -137,7 +127,6 @@ abstract class WP_REST_Controller {
|
||||
* Updates one item from the collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -150,7 +139,6 @@ abstract class WP_REST_Controller {
|
||||
* Checks if a given request has access to delete a specific item.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|bool True if the request has access to delete the item, WP_Error object otherwise.
|
||||
@@ -163,7 +151,6 @@ abstract class WP_REST_Controller {
|
||||
* Deletes one item from the collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -176,7 +163,6 @@ abstract class WP_REST_Controller {
|
||||
* Prepares one item for create or update operation.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_Error|object The prepared item, or WP_Error object on failure.
|
||||
@@ -189,7 +175,6 @@ abstract class WP_REST_Controller {
|
||||
* Prepares the item for the REST response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $item WordPress representation of the item.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -203,7 +188,6 @@ abstract class WP_REST_Controller {
|
||||
* Prepares a response for insertion into a collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Response $response Response object.
|
||||
* @return array|mixed Response data, ready for insertion into collection data.
|
||||
@@ -233,7 +217,6 @@ abstract class WP_REST_Controller {
|
||||
* Filters a response based on the context defined in the schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $data Response data to fiter.
|
||||
* @param string $context Context defined in the schema.
|
||||
@@ -275,7 +258,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves the item's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -287,7 +269,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves the item's schema for display / public consumption purposes.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Public item schema data.
|
||||
*/
|
||||
@@ -306,7 +287,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves the query params for the collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Query parameters for the collection.
|
||||
*/
|
||||
@@ -345,7 +325,6 @@ abstract class WP_REST_Controller {
|
||||
* Ensures consistent descriptions between endpoints, and populates enum from schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $args Optional. Additional arguments for context parameter. Default empty array.
|
||||
* @return array Context parameter details.
|
||||
@@ -384,7 +363,6 @@ abstract class WP_REST_Controller {
|
||||
* Adds the values from additional fields to a data object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $object Data object.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -410,7 +388,6 @@ abstract class WP_REST_Controller {
|
||||
* Updates the values of additional fields added to a data object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $object Data Object.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -445,7 +422,6 @@ abstract class WP_REST_Controller {
|
||||
* The type of object is inferred from the passed schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $schema Schema array.
|
||||
* @return array Modified Schema array.
|
||||
@@ -475,7 +451,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves all of the registered additional fields for a given object-type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $object_type Optional. The object type.
|
||||
* @return array Registered additional fields (if any), empty array if none or if the object type could
|
||||
@@ -504,7 +479,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves the object type this controller is responsible for managing.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string Object type for the controller.
|
||||
*/
|
||||
@@ -522,7 +496,6 @@ abstract class WP_REST_Controller {
|
||||
* Retrieves an array of endpoint arguments from the item schema for the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $method Optional. HTTP method of the request. The arguments for `CREATABLE` requests are
|
||||
* checked for required values and may fall-back to a given default, this is not done
|
||||
@@ -584,7 +557,6 @@ abstract class WP_REST_Controller {
|
||||
* Sanitizes the slug value.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @internal We can't use sanitize_title() directly, as the second
|
||||
* parameter is the fallback title, which would end up being set to the
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'wp/v2';
|
||||
@@ -31,7 +30,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -70,7 +68,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Checks whether a given request has permission to read post statuses.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has read access, WP_Error object otherwise.
|
||||
@@ -94,7 +91,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Retrieves all post statuses, depending on user context.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -122,7 +118,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read a post status.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise.
|
||||
@@ -147,7 +142,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Checks whether a given post status should be visible.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $status Post status.
|
||||
* @return bool True if the post status is visible, otherwise false.
|
||||
@@ -174,7 +168,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Retrieves a specific post status.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -195,7 +188,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Prepares a post status object for serialization.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param stdClass $status Post status data.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -243,7 +235,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Retrieves the post status' schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -305,7 +296,6 @@ class WP_REST_Post_Statuses_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'wp/v2';
|
||||
@@ -31,7 +30,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -69,7 +67,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Checks whether a given request has permission to read types.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|true True if the request has read access, WP_Error object otherwise.
|
||||
@@ -92,7 +89,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Retrieves all public post types.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -116,7 +112,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Retrieves a specific post type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -145,7 +140,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Prepares a post type object for serialization.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param stdClass $post_type Post type data.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -202,7 +196,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Retrieves the post type's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -278,7 +271,6 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Post type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $post_type;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Instance of a post meta fields object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var WP_REST_Post_Meta_Fields
|
||||
*/
|
||||
protected $meta;
|
||||
@@ -38,7 +36,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $post_type Post type.
|
||||
*/
|
||||
@@ -55,7 +52,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -126,7 +122,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read posts.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
|
||||
@@ -146,7 +141,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Retrieves a collection of posts.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -389,7 +383,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read a post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.
|
||||
@@ -430,7 +423,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* check in core with a filter.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_Post $post Post to check against.
|
||||
* @param WP_REST_Request $request Request data to check.
|
||||
@@ -460,7 +452,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Retrieves a single post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -485,7 +476,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to create a post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.
|
||||
@@ -520,7 +510,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Creates a single post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -624,7 +613,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to update a post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.
|
||||
@@ -660,7 +648,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Updates a single post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -748,7 +735,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to delete a post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
|
||||
@@ -770,7 +756,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Deletes a single post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -860,7 +845,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* them for WP_Query.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array.
|
||||
* @param WP_REST_Request $request Optional. Full details about the request.
|
||||
@@ -907,7 +891,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* modified date for single post output.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $date_gmt GMT publication time.
|
||||
* @param string|null $date Optional. Local publication time. Default null.
|
||||
@@ -932,7 +915,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Prepares a single post for create or update.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return stdClass|WP_Error Post object or WP_Error.
|
||||
@@ -1106,7 +1088,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Determines validity and normalizes the given status parameter.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $post_status Post status.
|
||||
* @param object $post_type Post type.
|
||||
@@ -1143,7 +1124,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Determines the featured media based on a request param.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $featured_media Featured Media ID.
|
||||
* @param int $post_id Post ID.
|
||||
@@ -1169,7 +1149,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Sets the template for a post.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $template Page template filename.
|
||||
* @param integer $post_id Post ID.
|
||||
@@ -1186,7 +1165,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Updates the post's terms from a REST request.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $post_id The post ID to update the terms form.
|
||||
* @param WP_REST_Request $request The request object with post and terms data.
|
||||
@@ -1214,7 +1192,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks whether current user can assign all terms sent with the current request.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_REST_Request $request The request object with post and terms data.
|
||||
* @return bool Whether the current user can assign the provided terms.
|
||||
@@ -1247,7 +1224,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a given post type can be viewed or managed.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object|string $post_type Post type name or object.
|
||||
* @return bool Whether the post type is allowed in REST.
|
||||
@@ -1270,7 +1246,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Correctly handles posts with the inherit status.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param object $post Post object.
|
||||
* @return bool Whether the post can be read.
|
||||
@@ -1314,7 +1289,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a post can be edited.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $post Post object.
|
||||
* @return bool Whether the post can be edited.
|
||||
@@ -1333,7 +1307,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a post can be created.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $post Post object.
|
||||
* @return bool Whether the post can be created.
|
||||
@@ -1352,7 +1325,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Checks if a post can be deleted.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $post Post object.
|
||||
* @return bool Whether the post can be deleted.
|
||||
@@ -1371,7 +1343,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Prepares a single post output for response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -1588,7 +1559,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* in a machine readable format, we remove the "Protected: " prefix.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Protected title format.
|
||||
*/
|
||||
@@ -1600,7 +1570,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Prepares links for the request.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
* @return array Links for the given post.
|
||||
@@ -1709,7 +1678,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Retrieves the post's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -2048,7 +2016,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for the posts collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
@@ -2243,7 +2210,6 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
* user can query private statuses.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string|array $statuses One or more post statuses.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Parent post type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $parent_post_type;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Parent controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access private
|
||||
* @var WP_REST_Controller
|
||||
*/
|
||||
private $parent_controller;
|
||||
@@ -38,7 +36,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* The base of the parent controller's route.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $parent_base;
|
||||
@@ -47,7 +44,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $parent_post_type Post type of the parent.
|
||||
*/
|
||||
@@ -64,7 +60,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Registers routes for revisions based on post types supporting revisions.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -148,7 +143,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to get revisions.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
|
||||
@@ -193,7 +187,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Gets a collection of revisions.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -218,7 +211,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to get a specific revision.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise.
|
||||
@@ -231,7 +223,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Retrieves one revision from the collection.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -255,7 +246,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to delete a revision.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
|
||||
@@ -284,7 +274,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Deletes a single revision.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True on success, or WP_Error object on failure.
|
||||
@@ -331,7 +320,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Prepares the revision for the REST response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_Post $post Post revision object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -437,7 +425,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* modified date for single post output.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $date_gmt GMT publication time.
|
||||
* @param string|null $date Optional. Local publication time. Default null.
|
||||
@@ -459,7 +446,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Retrieves the revision's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -547,7 +533,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
@@ -561,7 +546,6 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
* Checks the post excerpt and prepare it for single post output.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $excerpt The post excerpt.
|
||||
* @param WP_Post $post Post revision object.
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'wp/v2';
|
||||
@@ -31,7 +30,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -59,7 +57,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read and manage settings.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool True if the request has read access for the item, otherwise false.
|
||||
@@ -72,7 +69,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Retrieves the settings.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array|WP_Error Array on success, or WP_Error object on failure.
|
||||
@@ -117,7 +113,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Prepares a value for output based off a schema array.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param mixed $value Value to prepare.
|
||||
* @param array $schema Schema to match.
|
||||
@@ -147,7 +142,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Updates settings for the settings object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array|WP_Error Array on success, or error object on failure.
|
||||
@@ -217,7 +211,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Retrieves all of the registered options for the Settings API.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array Array of registered options.
|
||||
*/
|
||||
@@ -274,7 +267,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* Retrieves the site setting schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -306,7 +298,6 @@ class WP_REST_Settings_Controller extends WP_REST_Controller {
|
||||
* provide a wrapper sanitizer to whitelist the use of `null`.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value The value for the setting.
|
||||
* @param WP_REST_Request $request The request object.
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'wp/v2';
|
||||
@@ -31,7 +30,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -70,7 +68,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Checks whether a given request has permission to read taxonomies.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
|
||||
@@ -96,7 +93,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Retrieves all public taxonomies.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
@@ -133,7 +129,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to a taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
|
||||
@@ -158,7 +153,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Retrieves a specific taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -176,7 +170,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Prepares a taxonomy object for serialization.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param stdClass $taxonomy Taxonomy data.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -230,7 +223,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Retrieves the taxonomy's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -306,7 +298,6 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Taxonomy key.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $taxonomy;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Instance of a term meta fields object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var WP_REST_Term_Meta_Fields
|
||||
*/
|
||||
protected $meta;
|
||||
@@ -38,7 +36,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Column to have the terms be sorted by.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $sort_column;
|
||||
@@ -47,7 +44,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Number of terms that were found.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var int
|
||||
*/
|
||||
protected $total_terms;
|
||||
@@ -56,7 +52,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $taxonomy Taxonomy key.
|
||||
*/
|
||||
@@ -73,7 +68,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -136,7 +130,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Checks if a request has access to read terms in the specified taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has read access, otherwise false or WP_Error object.
|
||||
@@ -156,7 +149,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Retrieves terms associated with a taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -324,7 +316,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Checks if a request has access to read or edit the specified term.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
|
||||
@@ -345,7 +336,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Gets a single term from a taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -365,7 +355,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Checks if a request has access to create a term.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
|
||||
@@ -388,7 +377,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Creates a single term in a taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -467,7 +455,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Checks if a request has access to update the specified term.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has access to update the item, false or WP_Error object otherwise.
|
||||
@@ -489,7 +476,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Updates a single term from a taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -554,7 +540,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Checks if a request has access to delete the specified term.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object.
|
||||
@@ -576,7 +561,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Deletes a single term from a taxonomy.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -627,7 +611,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Prepares a single term for create or update.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return object $prepared_term Term object.
|
||||
@@ -680,7 +663,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Prepares a single term output for response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param obj $item Term object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -755,7 +737,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Prepares links for the request.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $term Term object.
|
||||
* @return array Links for the given term.
|
||||
@@ -817,7 +798,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Retrieves the term's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -897,7 +877,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
@@ -1006,7 +985,6 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
* Checks that the taxonomy is valid.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $taxonomy Taxonomy to check.
|
||||
* @return bool Whether the taxonomy is allowed for REST management.
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Instance of a user meta fields object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var WP_REST_User_Meta_Fields
|
||||
*/
|
||||
protected $meta;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'wp/v2';
|
||||
@@ -42,7 +40,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Registers the routes for the objects of the controller.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_route()
|
||||
*/
|
||||
@@ -148,7 +145,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* The value can be an integer, 'false', false, or ''.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param int|bool $value The value passed to the reassign parameter.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -172,7 +168,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Permissions check for getting all users.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has read access, otherwise WP_Error object.
|
||||
@@ -198,7 +193,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Retrieves all users.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -357,7 +351,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to read a user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object.
|
||||
@@ -387,7 +380,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Retrieves a single user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -408,7 +400,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Retrieves the current user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -432,7 +423,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access create users.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to create items, WP_Error object otherwise.
|
||||
@@ -450,7 +440,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Creates a single user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -559,7 +548,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to update a user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.
|
||||
@@ -585,7 +573,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Updates a single user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -671,7 +658,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to update the current user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise.
|
||||
@@ -686,7 +672,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Updates the current user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -701,7 +686,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access delete a user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
|
||||
@@ -723,7 +707,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Deletes a single user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -787,7 +770,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Checks if a given request has access to delete the current user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
|
||||
@@ -802,7 +784,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Deletes the current user.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
@@ -817,7 +798,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Prepares a single user output for response.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_User $user User object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -927,7 +907,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Prepares links for the user request.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_Post $user User object.
|
||||
* @return array Links for the given user.
|
||||
@@ -949,7 +928,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Prepares a single user for creation or update.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return object $prepared_user User object.
|
||||
@@ -1029,7 +1007,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Determines if the current user is allowed to make the desired roles change.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param integer $user_id User ID.
|
||||
* @param array $roles New user roles.
|
||||
@@ -1080,7 +1057,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Performs a couple of checks like edit_user() in wp-admin/includes/user.php.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value The username submitted in the request.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -1110,7 +1086,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Performs a couple of checks like edit_user() in wp-admin/includes/user.php.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value The password submitted in the request.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -1135,7 +1110,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Retrieves the user's schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Item schema data.
|
||||
*/
|
||||
@@ -1303,7 +1277,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* Retrieves the query params for collections.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return array Collection parameters.
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the object type for comment meta.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string The meta type.
|
||||
*/
|
||||
@@ -32,7 +31,6 @@ class WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the type for register_rest_field() in the context of comments.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return string The REST field type.
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Retrieves the object meta type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string One of 'post', 'comment', 'term', 'user', or anything
|
||||
* else supported by `_get_meta_table()`.
|
||||
@@ -29,7 +28,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Retrieves the object type for register_rest_field().
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string The REST field type, such as post type name, taxonomy name, 'comment', or `user`.
|
||||
*/
|
||||
@@ -39,7 +37,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Registers the meta field.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_field()
|
||||
*/
|
||||
@@ -55,7 +52,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Retrieves the meta field value.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param int $object_id Object ID to fetch meta for.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
@@ -96,7 +92,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* type before passing back to JSON.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param mixed $value Meta value to prepare.
|
||||
* @param WP_REST_Request $request Current request object.
|
||||
@@ -115,7 +110,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Updates meta values.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param array $meta Array of meta parsed from the request.
|
||||
* @param int $object_id Object ID to fetch meta for.
|
||||
@@ -167,7 +161,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Deletes a meta value for an object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $object_id Object ID the field belongs to.
|
||||
* @param string $meta_key Key for the field.
|
||||
@@ -202,7 +195,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Alters the list of values in the database to match the list of provided values.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $object_id Object ID to update.
|
||||
* @param string $meta_key Key for the custom field.
|
||||
@@ -274,7 +266,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Updates a meta value for an object.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $object_id Object ID to update.
|
||||
* @param string $meta_key Key for the custom field.
|
||||
@@ -320,7 +311,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Retrieves all the registered meta fields.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array Registered fields.
|
||||
*/
|
||||
@@ -379,7 +369,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Retrieves the object's meta schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array Field schema data.
|
||||
*/
|
||||
@@ -411,7 +400,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* `prepare_callback` in your `show_in_rest` options.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value Meta value from the database.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
@@ -453,7 +441,6 @@ abstract class WP_REST_Meta_Fields {
|
||||
* Check the 'meta' value of a request is an associative array.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value The meta value submitted in the request.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Post type to register fields for.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $post_type;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $post_type Post type to register fields for.
|
||||
*/
|
||||
@@ -41,7 +39,6 @@ class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the object meta type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string The meta type.
|
||||
*/
|
||||
@@ -53,7 +50,6 @@ class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the type for register_rest_field().
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @see register_rest_field()
|
||||
*
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Taxonomy to register fields for.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $taxonomy;
|
||||
@@ -29,7 +28,6 @@ class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Constructor.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $taxonomy Taxonomy to register fields for.
|
||||
*/
|
||||
@@ -41,7 +39,6 @@ class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the object meta type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string The meta type.
|
||||
*/
|
||||
@@ -53,7 +50,6 @@ class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the type for register_rest_field().
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return string The REST field type.
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@ class WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the object meta type.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @return string The user meta type.
|
||||
*/
|
||||
@@ -32,7 +31,6 @@ class WP_REST_User_Meta_Fields extends WP_REST_Meta_Fields {
|
||||
* Retrieves the type for register_rest_field().
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return string The user REST field type.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user