[Plugin: JSON API] Bug in save with attachements
Hey there is a bug here, when creating an attachment, upload works fine but JSON_API_Attachment is passed the attachment id to the constructor, not the attachement object. I think the following patch will fix.
--- wp-content/plugins/json-api/models/post.php (revision 594257) +++ wp-content/plugins/json-api/models/post.php (working copy) @@ -114,7 +114,7 @@ include_once ABSPATH . '/wp-admin/includes/media.php'; include_once ABSPATH . '/wp-admin/includes/image.php'; $attachment_id = media_handle_upload('attachment', $this->id); - $this->attachments = new JSON_API_Attachment($attachment_id); + $this->attachments = new JSON_API_Attachment( get_post($attachment_id) ); unset($_FILES['attachment']); }
- The topic ‘[Plugin: JSON API] Bug in save with attachements’ is closed to new replies.