Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ public function register_routes() {
*/
public function prepare_item_for_response( $item, $request ) {
// Don't prepare the response body for HEAD requests.
if ( $request->is_method( 'HEAD' ) ) {
/*
* Gutenberg only. Do not backport this change to core.
* Using the get_method() method to check the request method
* to satisfy the minimum `GUTENBERG_MINIMUM_WP_VERSION` version requirement for WordPress 6.7 and above.
* Once 6.9 is released, we can make Gutenberg's minimum version
* requirement 6.8 and then use the is_method() method instead.
* See: https://core.trac.wordpress.org/changeset/59899
*/
if ( 'HEAD' === $request->get_method() ) {
return new WP_REST_Response( array() );
}

Expand Down
Loading