{"action":"opened","issue":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/1359","labels_url":"https://api.github.com/repos/WP-API/WP-API/issues/1359/labels{/name}","comments_url":"https://api.github.com/repos/WP-API/WP-API/issues/1359/comments","events_url":"https://api.github.com/repos/WP-API/WP-API/issues/1359/events","html_url":"https://github.com/WP-API/WP-API/issues/1359","id":89263483,"number":1359,"title":"post update with featured image did not work until ...","user":{"login":"eflatz","id":5519311,"avatar_url":"https://avatars.githubusercontent.com/u/5519311?v=3","gravatar_id":"","url":"https://api.github.com/users/eflatz","html_url":"https://github.com/eflatz","followers_url":"https://api.github.com/users/eflatz/followers","following_url":"https://api.github.com/users/eflatz/following{/other_user}","gists_url":"https://api.github.com/users/eflatz/gists{/gist_id}","starred_url":"https://api.github.com/users/eflatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eflatz/subscriptions","organizations_url":"https://api.github.com/users/eflatz/orgs","repos_url":"https://api.github.com/users/eflatz/repos","events_url":"https://api.github.com/users/eflatz/events{/privacy}","received_events_url":"https://api.github.com/users/eflatz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-18T11:09:38Z","updated_at":"2015-06-18T11:09:38Z","closed_at":null,"body":"Hi,\r\n\r\nI had error sending update (PUT) request for posts to attach featured image which is uploaded in the request before. Wordpress would return 500 internal server error. After debugging the process I discovered in the class-wp-json-media.php ( function attach_thumbnail( $post, $data, $update ) ) wrong parameter passing to set_post_thumbnail function.\r\n\r\nCurrently in the source code:\r\nset_post_thumbnail( $post['ID'], $thumbnail['ID'] );\r\n-> this throws error because $thumbnail does not have ID property but its child data property instead\r\n\r\nSo after putting:\r\nset_post_thumbnail( $post['ID'], $thumbnail->data['ID'] );\r\n-> you can pass json {\"featured_image\":(int) post id } on wp-json/post/post_id and featured image is attached to post\r\n\r\nCan this be updated in the next release?\r\n\r\nThanks,\r\nEmil\r\n    "}}