WP_REST_Request::__construct( string $method = '', string $route = '', array $attributes = array() )
Constructor.
Description Description
Parameters Parameters
- $method
-
(string) (Optional) Request method.
Default value: ''
- $route
-
(string) (Optional) Request route.
Default value: ''
- $attributes
-
(array) (Optional) Request attributes.
Default value: array()
Source Source
File: wp-includes/rest-api/class-wp-rest-request.php
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 ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Request objects can also be constructed from a URL by using
WP_REST_Request::from_url
: