From 6cc98e6fcd579c7a0eb4337a38f8c08c519e26b2 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 3 Dec 2015 16:34:25 +0000 Subject: [PATCH] Route HEAD API requests through the GET callback method fixes #34837 props danielbachhuber Built from https://develop.svn.wordpress.org/trunk@35758 git-svn-id: http://core.svn.wordpress.org/trunk@35722 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 62f7343069..2c46fd8d58 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -780,7 +780,8 @@ class WP_REST_Server { $callback = $handler['callback']; $response = null; - if ( empty( $handler['methods'][ $method ] ) ) { + $checked_method = 'HEAD' === $method ? 'GET' : $method; + if ( empty( $handler['methods'][ $checked_method ] ) ) { continue; } diff --git a/wp-includes/version.php b/wp-includes/version.php index fe2032da99..786cf0ffd6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-RC1-35757'; +$wp_version = '4.4-RC1-35758'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.