[wp-hackers] Adding the "Insert From URL" tab to a 3.5 upload modal

Ian Dunn ian at iandunn.name
Wed Mar 27 21:50:26 UTC 2013


I'm trying to add the "Insert From URL" tab to a 3.5 media upload modal 
in a widget, but I'm stumped.

I've inserted the uploader by running this JavaScript when a button is 
clicked on: http://pastebin.com/wLJ56z76. That gives me a modal that has 
the "Upload Files" and "Media Library" tabs 
(http://i.stack.imgur.com/KV78g.png), but I also want it to have the 
"Insert From URL" tab that you get when you click on the "Add Media" 
button while editing a post/page.

I've spent a couple hours digging around the web, reading through the 
source code and watching Daryl Koopersmith's presentation on the 
uploader's internals (http://www.youtube.com/watch?v=j5KPXLzuBXE), but 
haven't been able to figure out how to add the URL tab.

Can someone point me in the right direction? Is there a parameter I can 
pass to wp.media() to include it, or should I use one of the built-in 
views/models that includes it?

Thanks,
Ian


More information about the wp-hackers mailing list