Opened 17 years ago
Closed 16 years ago
#7219 closed defect (bug) (fixed)
the_media_upload_tabs() always shows first tab as active
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.5.1 |
Component: | General | Keywords: | has-patch tested |
Focuses: | Cc: |
Description
When parameter $_GET[tab] is not passed over to media-upload.php it will show the default tab that is returned by $tab = apply_filters('media_upload_default_tab', 'type');
However the tabbar created by function the_media_upload_tabs() at the top will always show the first tab as active if the parameter is missing:
if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) $current = $_GET['tab']; else { $keys = array_keys($tabs); $current = array_shift($keys); }
This should be changed so that the default tab in this case is also the default tab:
if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) $current = $_GET['tab']; else { $current = apply_filters('media_upload_default_tab', 'type'); }
A patch is attached. Another possibility would be to use global $tab; that should already be defined when the function is called.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Patch for defect