Você pode tentar o seguinte script:
var MEDIAmedia_library: function() {
var formfield = null;
var wireframe;
$('body').on('click', '#click-event-selector',function(e) {
e.preventDefault();
if (wireframe) {
wireframe.open();
return;
}
wireframe = wp.media.frames.wireframe = wp.media({
title: 'Media Library Title',
button: {
text: 'Media Library Button Title'
},
multiple: false
});
wireframe.on('select', function() {
attachment = wireframe.state().get('selection').first().toJSON();
console.log(attachment);
$('#input-field-selector').val(attachment.url);
});
wireframe.open();
});
}
#click-event-selector
do seletor de evento de clique
#input-field-selector
do valor do campo de entrada para inserir as propriedades do objeto selecionado
Você também pode envolver essa função em qualquer modal jquery
Referência Wordpress 3.5 Media Uploader