WP_REST_Request::__construct
Constructor.
Метод класса: WP_REST_Request{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WP_REST_Request = new WP_REST_Request(); $WP_REST_Request->__construct( $method, $route, $attributes );
- $method(строка)
- Request method.
По умолчанию: '' - $route(строка)
- Request route.
По умолчанию: '' - $attributes(массив)
- Request attributes.
По умолчанию: empty array
Список изменений
| С версии 4.4.0 | Введена. |
Код WP_REST_Request::__construct() WP REST Request:: construct WP 6.8.3
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 );
}