Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#22582 closed defect (bug) (duplicate)

Backward compatibility for the library query in the new "add media" modal

Reported by: Chouby Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch
Focuses: Cc:


In WP 3.4, when querying the database to populate the media library in the "upload/insert" media modal, $_REQUEST['post_id'] contains the id of the post currently edited. This allows plugins to filter the media in the library based on informations contained in the post currently edited (using the 'parse_query' filter).

In WP 3.5 RC1 with the new "Add media" modal, $_REQUEST contains only two indexes 'action' and 'query'. So far I did not find a way to get the id of the post currently edited.

See also #22186

Attachments (2)

22582.diff (591 bytes) - added by Chouby 8 years ago.
22582.2.diff (592 bytes) - added by chouby 8 years ago.

Download all attachments as: .zip

Change History (9)

8 years ago

#1 @Chouby
8 years ago

  • Keywords has-patch added

#2 @nacin
8 years ago

  • Milestone changed from Awaiting Review to 3.5

I imagine it should be .post_id, right?

8 years ago

#3 @chouby
8 years ago

Oh yes of course you are right!

#4 @Chouby
8 years ago

Should we close this ticket as it seems now duplicate from #22588?

#5 @nacin
8 years ago

Yep, thanks for the start here. Your comments in #22186 drove me to creating a more inclusive ticket. Could you test the patch there against your code?

#6 @nacin
8 years ago

  • Milestone 3.5 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #22588.

#7 @Chouby
8 years ago

I tested the rev 22873 and this issue is solved for me. Thank you.

Note: See TracTickets for help on using tickets.