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.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-request.php

	public function set_attributes( $attributes ) {
		$this->attributes = $attributes;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.