We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75c587f commit c023d53Copy full SHA for c023d53
src/wp-includes/rest-api/class-wp-rest-request.php
@@ -161,6 +161,18 @@ public function get_headers() {
161
return $this->headers;
162
}
163
164
+ /**
165
+ * Determines if the request is the given method.
166
+ *
167
+ * @since 6.8.0
168
169
+ * @param string $method HTTP method.
170
+ * @return bool Whether the request is of the given method.
171
+ */
172
+ public function is_method( $method ) {
173
+ return $this->get_method() === strtoupper( $method );
174
+ }
175
+
176
/**
177
* Canonicalizes the header name.
178
*
0 commit comments