REST API: Cast revision author ID to int.

The `post_author` field is a string internally, but we need to cast it to an integer in the REST API.  This was already done for posts, but not for revisions.  The field is already declared as an integer in both controllers.

Fixes #39871.

Built from https://develop.svn.wordpress.org/trunk@40063


git-svn-id: http://core.svn.wordpress.org/trunk@40000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
James Nylen 2017-02-16 20:09:45 +00:00
parent 59d33e90da
commit cb7a9a731d
2 changed files with 2 additions and 2 deletions

View File

@ -344,7 +344,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
$data = array();
if ( ! empty( $schema['properties']['author'] ) ) {
$data['author'] = $post->post_author;
$data['author'] = (int) $post->post_author;
}
if ( ! empty( $schema['properties']['date'] ) ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40062';
$wp_version = '4.8-alpha-40063';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.