diff --git a/json-endpoints/class.wpcom-json-api-post-endpoint.php b/json-endpoints/class.wpcom-json-api-post-endpoint.php index 713fa68ae13f..917c7d7ac397 100644 --- a/json-endpoints/class.wpcom-json-api-post-endpoint.php +++ b/json-endpoints/class.wpcom-json-api-post-endpoint.php @@ -613,9 +613,9 @@ function get_attachment( $attachment ) { */ function get_current_user_capabilities( $post ) { return array( - 'publish_post' => current_user_can( 'publish_post', $post ), - 'delete_post' => current_user_can( 'delete_post', $post ), - 'edit_post' => current_user_can( 'edit_post', $post ) + 'publish_post' => current_user_can( 'publish_post', $post->ID ), + 'delete_post' => current_user_can( 'delete_post', $post->ID ), + 'edit_post' => current_user_can( 'edit_post', $post->ID ) ); } diff --git a/sal/class.json-api-post-base.php b/sal/class.json-api-post-base.php index 4ee02cc14700..7577d991c25e 100644 --- a/sal/class.json-api-post-base.php +++ b/sal/class.json-api-post-base.php @@ -182,9 +182,9 @@ public function get_meta() { public function get_current_user_capabilities() { return array( - 'publish_post' => current_user_can( 'publish_post', $this->post ), - 'delete_post' => current_user_can( 'delete_post', $this->post ), - 'edit_post' => current_user_can( 'edit_post', $this->post ) + 'publish_post' => current_user_can( 'publish_post', $this->post->ID ), + 'delete_post' => current_user_can( 'delete_post', $this->post->ID ), + 'edit_post' => current_user_can( 'edit_post', $this->post->ID ) ); } @@ -458,7 +458,7 @@ public function get_author() { if ( 0 == $this->post->post_author ) return null; - $show_email = $this->context === 'edit' && current_user_can( 'edit_post', $this->post ); + $show_email = $this->context === 'edit' && current_user_can( 'edit_post', $this->post->ID ); $user = get_user_by( 'id', $this->post->post_author );