#21085 closed enhancement (worksforme)
Better XML-RPC media handling
Reported by: | markoheijnen | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.3 |
Component: | XML-RPC | Keywords: | reporter-feedback needs-patch |
Focuses: | Cc: |
Description
In 3.4 there was a lot of improvements. For 3.5 I would like to see some major improvement in wp.uploadFile and metaWeblog.newMediaObject.
At this moment you can't insert a description, alternate text or caption. ( #5461/#18684 ). Also the file can't be attached to a post ( #13917 ).
The overwrite functionality also doesn't work ( #17604 ). Not sure why this exists since WordPress itself doesn't do this.
Also the current way isn't how WordPress does it internally. wp_handle_upload() doesn't get used (#6559).
There is also going on something wrong with mime types ( #12518 ).
Also the work from 3.4 should be implemented ( #6430 ).
Last thing is that WordPress normally also looks at the EXIF information. At this moment the XML-RPC also doesn't do that ( #18087 )
rarely related: #12493 - filter for wp_upload_bits
Attachments (1)
Change History (21)
#2
@
12 years ago
- Cc isaackeyet added
+1 for an updated way to handle new media items specifically. Images should be attachable to posts directly.
#4
@
12 years ago
- Summary changed from mw_newMediaObject needs more functionality to Better XML-RPC media handling
#7
@
12 years ago
- Cc gary@… added
Related - adding resumable upload support to the XML-RPC API: #21497
#9
@
12 years ago
Added patch with wp.deleteMediaItem. I wonder if that method should have an extra $force_delete
argument (see wp_delete_attachment)
#10
@
12 years ago
The same parameter should be added to wp.deletePost. Currently it must be called twice to delete the post, as the first one trashes.
#11
follow-up:
↓ 12
@
12 years ago
Note also that attachments do not have trash enabled, so wp.deleteMediaItem should not actually bother with a force_delete for now.
#12
in reply to:
↑ 11
@
12 years ago
Replying to nacin:
Note also that attachments do not have trash enabled, so wp.deleteMediaItem should not actually bother with a force_delete for now.
OK, the docs for wp_delete_attachment made me think otherwise
#13
@
12 years ago
- Keywords 2nd-opinion added
The cap check here should be delete_post, $post_id
. And in that case, the cap check should come before the invalid ID check.
Not sure why wp.deleteMediaItem should be needed — wp.deletePost is functionally equivalent. At most wp.deleteMediaItem should be an alias.
#14
@
12 years ago
I see a lot of tickets listed in the description here, but few of them are currently slated for 3.5, and few have any recent activity. Not sure what else to do here.
#15
@
12 years ago
- Type changed from defect (bug) to enhancement
I punted it for now. It's something that need to be discussed more but way to late for 3.5 since it's an enchantment of the existing API.
#17
@
10 years ago
- Keywords reporter-feedback added; mobile 2nd-opinion removed
@markoheijnen did you want to continue persuing this?
I worry that it will be difficult to add new features and fix all of these issues without breaking existing clients. Media uploading is already a problematic area for many clients, and trying to patch wp.uploadFile/mw.newMediaObject without breaking things is likely not worth the effort.
Instead, I propose that we add a new method for creating and editing media/attachments that is better aligned with modern core functionality:
wp.newMediaItem
method for uploading files.wp.editMediaItem
method for editing existing media files.wp.getMediaItems
alias for the existingwp.getMediaLibrary
method.wp.uploadFile
andmw.newMediaObject
(though all ofmw.*
,mt.*
andblogger.*
should be deprecated).