Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#16220 closed defect (bug) (duplicate)

Media Upload from custom tab using Flash Uploader is broken

Reported by: jackcrosby Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.4
Component: Upload Keywords:
Focuses: Cc:
PR Number:


If you create a custom tab in the Media Uploader, and try to upload using the Flash Upload method (as opposed to the Browser Upload method), any hooks you have in place to intercept the upload (media_upload_$tab) will not be triggered.

Reason: The upload function are not aware of the tab. Even though the Flash Uploader passes the $tab variable, the upload functions are not receiving it.

Cause: The $tab variable is set from the GET string ($_GET['tab']). This only works with the Browser Upload method. Flash passes variables with POST($_POST['tab']).

Fix: Inside /wp-admin/media-upload.php and /wp-admin/includes/media.php replace all $_GET['tab'] with $_REQUEST['tab'].
Also, the global $tab variable must be set.
Add it to /wp-admin/includes/media.php around line #101 after the 'else{'
global $tab;

Change History (4)

#1 @ocean90
9 years ago

  • Keywords upload media upload tab removed

Related: #15655

#2 @jackcrosby
9 years ago

That should be '/wp-admin/media-upload.php' that needs 'global $tab;' after the else on line #104

#3 @jackcrosby
9 years ago

Hmmm... WP 3.1 changed something. Now the $tab isn't getting passed at all.

#4 @ocean90
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.