WP_REST_Request::set_attributes() WordPress Method
The WP_REST_Request::set_attributes() is aWordpress method used to set the request attributes. The attributes are used to determine how the request will be handled. This method can be used to set the following attributes: · Method: The HTTP method to be used for the request. · Body: The body of the request. · Headers: An array of request headers. · Cookies: An array of request cookies. · Query params: An array of request query parameters. · Files: An array of request files. · Auth: The authentication method to be used for the request. · USD: The currency to be used for the request.
WP_REST_Request::set_attributes( array $attributes ) #
Sets the attributes for the request.
Parameters
- $attributes
(array)(Required)Attributes for the request.
Source
File: wp-includes/rest-api/class-wp-rest-request.php
public function set_attributes( $attributes ) { $this->attributes = $attributes; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |