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
This commit is contained in:
Mark Jaquith 2015-12-03 16:34:25 +00:00
parent 939291df9f
commit 6cc98e6fcd
2 changed files with 3 additions and 2 deletions

View File

@ -780,7 +780,8 @@ class WP_REST_Server {
$callback = $handler['callback']; $callback = $handler['callback'];
$response = null; $response = null;
if ( empty( $handler['methods'][ $method ] ) ) { $checked_method = 'HEAD' === $method ? 'GET' : $method;
if ( empty( $handler['methods'][ $checked_method ] ) ) {
continue; continue;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.