WP_REST_Request::is_method( string $method ): bool

In this article

Determines if the request is the given method.

Parameters

$methodstringrequired
HTTP method.

Return

bool Whether the request is of the given method.

Source

public function is_method( $method ) {
	return $this->get_method() === strtoupper( $method );
}

Changelog

VersionDescription
6.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.