Title: WP_REST_Request::offsetSet
Published: December 9, 2015
Last modified: May 20, 2026

---

# WP_REST_Request::offsetSet( string $offset, mixed $value )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#wp--skip-link--target)

Sets a parameter on the request.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#parameters)󠁿

 `$offset`stringrequired

Parameter name.

`$value`mixedrequired

Parameter value.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#source)󠁿

    ```php
    #[ReturnTypeWillChange]
    public function offsetSet( $offset, $value ) {
    	$this->set_param( $offset, $value );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-request.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/class-wp-rest-request.php#L1014)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/class-wp-rest-request.php#L1014-L1017)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Request::set_param()](https://developer.wordpress.org/reference/classes/wp_rest_request/set_param/)`wp-includes/rest-api/class-wp-rest-request.php` |

Sets a parameter on the request.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_request/offsetset/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_request%2Foffsetset%2F)
before being able to contribute a note or feedback.