WP_REST_Request::offsetUnset()publicWP 4.4.0ReturnTypeWillChange

Removes a parameter from the request.

Method of the class: WP_REST_Request{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_REST_Request = new WP_REST_Request();
$WP_REST_Request->offsetUnset( $offset );
$offset(string) (required)
Parameter name.

Changelog

Since 4.4.0 Introduced.

WP_REST_Request::offsetUnset() code WP 6.5.2

public function offsetUnset( $offset ) {
	$order = $this->get_parameter_order();

	// Remove the offset from every group.
	foreach ( $order as $type ) {
		unset( $this->params[ $type ][ $offset ] );
	}
}