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

Luke Bryan lukebryan at sharefaith.com
Sat Mar 30 16:29:08 UTC 2013

For debugging Wordpress' javascript, it's very helpful to have the
minifying turned off:

Now enter 'wp.media' in Firebug, it will give you a link to the function
definition. As you can see in the source, there are two completely
different classes that are called up depending on the frame attribute:

if ( 'select' === attributes.frame && MediaFrame.Select )
frame = new MediaFrame.Select( attributes );
else if ( 'post' === attributes.frame && MediaFrame.Post )
frame = new MediaFrame.Post( attributes );

Which is why wp.media({frame:'select'}).open() (simple, featured image
picker) is completely different than wp.media({frame:'post'}).open() full

To expand upon this question - I'm also wondering why these are separate
classes for basically the same file picking functionality. The frame:post
option gives a picker similar to the old one, which shows the insert-url
tab, and can be hooked by NextGen gallery and others, but the simple
featured-image-picker doesn't seem to have any way to hook plugin
functionality into it (or add insert-url tab).

This answer here looks like the new right-way to extend the new WP3.5
uploader, without the old style iframes. Unfortunately, it doesn't show in
the simple (featured-image) picker. A similar problem exists in NextGen
now, since you can't select a NextGen image from the featured-image.

Is there a recommended way to add a nextgen-style picker, or an additional
option to the 'media' category, for both the post-uploader and the
featured-image style uploader? Will these two pickers be unified in 3.6 or

Best regards,

More information about the wp-hackers mailing list