WP_REST_Request::set_method() WordPress Method
The set_method() method is used to set the request method for a given request. This is useful for specifying a different request method than the default.
WP_REST_Request::set_method( string $method ) #
Sets HTTP method for the request.
Parameters
- $method
(string)(Required)HTTP method.
Source
File: wp-includes/rest-api/class-wp-rest-request.php
public function set_method( $method ) { $this->method = strtoupper( $method ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |