[wp-trac] [WordPress Trac] #17578: Merge media buttons into one
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 30 00:48:20 UTC 2011
#17578: Merge media buttons into one
------------------------------------+------------------
Reporter: mitchoyoshitaka | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.3
Component: Media | Version:
Severity: trivial | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------
Comment (by nacin):
[attachment:17578.3.diff] is the result of a closer inspection of the guts
of what we're working with here.
* Merges in code from media_upload_file() (and audio, and video -- these
are all the same) to properly put together a simple hyperlink to then send
to the editor.
* Restores the three filters that I previously needed to remove. It
triggers *_send_to_editor_url with audio, video, or file by checking the
file extension (file being the fallback).
* Enables old links to tab=type_url&tab=video (or audio, or file) to
still work, by making the audio/video/file form visible and the image form
hidden.
* Only do a check on whether the image URL is valid for images. (This is
where the green checkmark comes from. We don't do this for
audio/video/file.)
* Channeled my inner azaozz and changed how toggle is implemented, moving
it to a single class on a single parent element, with CSS to then handle
on/off.
* Killed a filter, 'type_url_form_$type', which filtered the entirety of
the URL form previously. This is silly. While we can now predict what the
type will be (it'll always be image, unless someone does a custom URL, as
stated above), the form structure has changed as elements have been added.
In return, I've introduced type_url_form_media, a generic filter people
can now use.
* Restores the async_upload_* hooks as they're still needed for async-
upload.php (though I've put in a Q to azaozz as to whether we need to keep
that file around).
At this point, it's been pretty well hammered by both myself and ryan.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17578#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list