Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to create an edit media button for my plugin, right now you can easily upload images using the WordPress 3.5 media uploader but I want the user to be able to edit the uploaded images, something like this:

example of uploader

Any ideas on how that can be achieved?

Here is the code that I am using to open the media uploader right now:

    var file_frame;
jQuery('#asp_slides_upload').live('click', function(event){

    event.preventDefault();

    if (file_frame) {
        file_frame.open();
        return;
    }

    file_frame = wp.media.frames.file_frame = wp.media({
        title: jQuery(this).data('uploader_title'),
        button: {
            text: jQuery( this ).data('uploader_button_text'),
        },
        multiple: true
    });

    file_frame.on('select', function() {
        var selection = file_frame.state().get('selection');
        var postID = jQuery('#asp_gallery_id').attr('value');
        attachments = selection.toJSON();
        printableAttachment = JSON.stringify(attachments, null, 2);
        jQuery.ajax({
            type: "POST",
            dataType: "JSON",
            url: aspAdminUrls.ajaxurl,
            data: {
                action: 'asp_save_slides',
                content: attachments,
                postID: postID
            },
            success: function(data) {
                jQuery('#asp_slides_holder').append(data);
            }
        });

    });

    file_frame.open();
});
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I think you are on the same boat with us: http://wordpress.org/extend/ideas/topic/custom-attachment-type

Its not possible easily at the moment. If you and others supports my idea, maybe we will see it for wordpress 3.7

share|improve this answer
    
Is this an answer to the OPs question? –  Johannes Pille Mar 24 '13 at 13:44
    
Yes. Shortly: not possible easily. And link to idea is explaining why. –  Ünsal Korkmaz Mar 24 '13 at 14:29
    
IMHO, "not possible easily" is a non-answer that translates to "possible, but I don't know / am not going to explain how"... –  Johannes Pille Mar 24 '13 at 14:52
    
Thank you for your response Ünsal, unfortunately it didn`t answer my question. I believe that the new media uploader is intended to work differently as you can only edit the images after you upload them under the attachment post edit screen (you can no longer edit it through the thickbox window). I`ll start working on a custom script that allows me to do that in my plugin. –  Vitor Argos Apr 13 '13 at 16:16
    
Well, i explained way to edit new media panels here: unsalkorkmaz.com/… Maybe it shows you a way. Meanwhile, you can use old media uploader: wordpress.stackexchange.com/questions/81806/… –  Ünsal Korkmaz Apr 13 '13 at 17:23
show 1 more comment

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.