Opened 12 years ago
Closed 11 years ago
#26587 closed defect (bug) (fixed)
wp.media library argument post__not_in breaks the uploads
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.1 | Priority: | normal |
| Severity: | normal | Version: | 3.8 |
| Component: | Media | Keywords: | has-patch |
| Focuses: | javascript | Cc: |
Description
- Open any page with media uploader, type in JavaScript console:
wp.media({library : { post__not_in : [123]}}).open()
- Then try to upload a file.
Notice that the Select file button does not work, new uploads does not show the progress bar nor the item being uploaded in the attachment area.
However post__not_in itself works in wp_ajax_query_attachments correctly by filtering only given attachment ID's from the list.
Attachments (1)
Change History (6)
#1
@
12 years ago
- Focuses javascript added
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 3.9
#2
follow-up:
↓ 3
@
12 years ago
This bug is not related to the post__not_in property. Setting library to a JSON object containing any property except order or orderby results in this behavior.
#3
in reply to:
↑ 2
@
12 years ago
- Milestone changed from 3.9 to Future Release
Replying to tlovett1:
This bug is not related to the
post__not_inproperty. Settinglibraryto a JSON object containing any property exceptorderororderbyresults in this behavior.
Sounds then like this is not a serious bug, but just incomplete API. Moving to future.
#4
@
11 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 4.1
26587.diff allows you to pass include and exclude to Query.get(), which are aliases for post__in and post__not_in.
Example usage:
wp.media({frame: 'post', library: {include: [414, 415]}}).open()
wp.media({frame: 'post', library: {include: 414}}).open()
wp.media({frame: 'post', library: {exclude: [414, 415]}}).open()
wp.media({frame: 'post', library: {exclude: 414}}).open()
All of the parsed props are aliases, include and exclude are in line with what we do elsewhere.
Confirmed