Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

To expand: I'd like to utilize the same Modal code/appearance ( as used in wp.media.Modal, wp.media.FocusManager ) to open a modal of my own custom dialog, not the Media Editor. In the past, I've used thickbox for this sort of thing, but wp.media.Modal appears to be the way of the future for modals -- Not to mention it looks cool.

I've poked at the JS source a bit and have come to a couple possible solutions:

  1. "Borrow" the code media-views.js and use it in my plugin.
  2. "Extend" wp.media.Modal ( it is a Backbone View, after all ).
  3. Create a custom implementation, jQueryUI, etc.
  4. Just give up and use thickbox.

Borrowing seems slightly less dangerous than using wp.media.Model.extend({}), but wasteful. I'm not a big fan of jQueryUI's modals, but it would get the job done. At the same time, I could do a custom implementation of modals ( or base it off another lib ).

Feels like I'm missing something obvious: Has anyone else pulled this off or is the new media library modal code "too new" to allow for reuse?

share|improve this question
3  
Looks like you're just missing trying it out. I'd recommend going for #2: probably the cleanest and most challenging/fun, plus it sounds like you know your way around Backbone. – dalbaeb Mar 19 at 4:02
1  
please share your findings! – paul Apr 14 at 12:24

1 Answer

Dominik Schilling - the author of the WP 3.5 media manager - has written a set of demos for media modals. You can view them on GitHub.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.