Opened 6 months ago
Closed 6 months ago
#22588 closed defect (bug) (fixed)
Back compat $_REQUEST['post_id'] for media XHR requests
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | frederic.demarle@… |
Description (last modified by nacin)
query-attachments, save-attachments, and save-attachments-compat should all pass back 'post_id', for consistency with the old media-upload.php dialog, as plugins may be doing $_REQUEST['post_id'] checks in conjunction with parse_query, save_post, attachment_fields_to_save, or other filters.
We should consider also calling set_current_screen( 'media-upload' ) for these three requests, or for at least query-attachments, to allow the current screen object to be accurate. It's kind of hacky, and doesn't handle $pagenow, but it is something to consider.
Attachments (3)
Change History (12)
koopersmith — 6 months ago
comment:2
koopersmith — 6 months ago
- Keywords has-patch added
comment:3
koopersmith — 6 months ago
- Keywords needs-patch added; has-patch removed
Ignore that. Parts of the patch confuse the post ID we're acting on with the post ID context (the post we're editing while we perform the action).
koopersmith — 6 months ago
comment:5
koopersmith — 6 months ago
- Keywords has-patch added; needs-patch removed
Let's try this again.
- Keywords commit added
Tested before and after, logging the ajax requests. Looks good.

Patch adds support for $_REQUEST['post_id'] in all media ajax requests.