WP_REST_Request::__construct
Constructor.
Method of the class: WP_REST_Request{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_REST_Request = new WP_REST_Request(); $WP_REST_Request->__construct( $method, $route, $attributes );
- $method(string)
- Request method.
Default:'' - $route(string)
- Request route.
Default:'' - $attributes(array)
- Request attributes.
Default:empty array
Changelog
| Since 4.4.0 | Introduced. |
WP_REST_Request::__construct() WP REST Request:: construct code WP 7.0
public function __construct( $method = '', $route = '', $attributes = array() ) {
$this->params = array(
'URL' => array(),
'GET' => array(),
'POST' => array(),
'FILES' => array(),
// See parse_json_params.
'JSON' => null,
'defaults' => array(),
);
$this->set_method( $method );
$this->set_route( $route );
$this->set_attributes( $attributes );
}