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.

Usage

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

WP_REST_Request::offsetUnset() code WP 6.1.1

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

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