2

I am trying to change the allowed file extensions of a valums file uploader that is being used by a (wordpress) plugin I have to use.

Since I don't want to change the plugin's source files, I am trying to set these from outside of the plugin. The plugin init's the FileUploader within a closure and does not expose the variable. Is there a way to access the instances of the FileUploaders via the global qq or otherwise? I examined the qq object in the console and checked out the source code but don't see any way to access it's instances :/.

If there is no way to access it, is it possible to destroy and rebuild the instances of the FileUploader without having access to the var it was assigned to?

Update: this is how the plugin creates the file uploader:

(function($){

// ...

var BpfbPhotoHandler = function () {

    var createMarkup = function () {
        // ...

        var uploader = new qq.FileUploader({
            "element": $('#bpfb_tmp_photo')[0],
            "listElement": $('#bpfb_tmp_photo_list')[0],
            "allowedExtensions": ['jpg', 'jpeg', 'png', 'gif'],
            "action": ajaxurl,
            "params": {
                "action": "bpfb_preview_photo"
            },
            "onSubmit": function (id) {
                //...
            },
            "onComplete": createPhotoPreview,
            template: '...'
        });
    };

};

// ...

})(jQuery);

Thanks.

Christof
  • 3,777
  • 4
  • 37
  • 49

0 Answers0