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:
parent
59d33e90da
commit
cb7a9a731d
|
@ -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'] ) ) {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue