#21329 closed enhancement (wontfix)
Consolidate filters and functions in wp-admin/includes/media.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
in wp-admin/media.php, there are several functions that do similar things and could be combined, simplifying how they get used.
Attachments (6)
Change History (18)
#3
@
11 years ago
I wasn't aware of the current_filter() function. Here is take 2 with the original filters back in place.
#5
@
11 years ago
I'm just going to keep going with this ticket in an attempt to cleanup the media.php file and all its functions. Maybe some of it will be useful or some will be a waste of time but I have some time to kill. :)
@
11 years ago
remove media_upload_gallery and media_upload_library, add comments about functions that could be deprecated to end of file
#6
@
11 years ago
Ignore patch 3 and 4. I was grabbing wrong patch files. Sorry. Would remove them if I could see how.
#7
@
11 years ago
- Summary changed from Consolidate media_upload filters and functions to Consolidate filters and functions in wp-admin/includes/media.php
#8
@
11 years ago
I have the patches between 5 and 8 if you want to see my steps but this was all just a reorganization of existing functions, making sure upload thickbox still worked for all tabs.
In 8, I grouped all the html for a standalone upload form ( the dragndrop area ) into one function wp_upload_form() that takes a number af $args to define it. I haven't tested replacing the inline form in media-new.php but it works as a replacement in the post/page upload window.
#10
@
10 years ago
If this reduced the amount of code in the file, making it easier to maintain as we slowly wind down support for the legacy media code, I think I'd be for it. But it actually adds a few dozen lines.
#11
@
10 years ago
- Keywords close removed
- Resolution set to wontfix
- Status changed from new to closed
Seems like a lot of code changes to be making on a legacy component. Mostly refactoring see: http://make.wordpress.org/core/2011/03/23/code-refactoring/
It would be good if you added a useful description to this new media_upload() function.
Also, I'm not sure about the implications of changing the filter from:
"media_upload_$type"
to:
"media_upload", $type