I need to modify the output of the new Wordpress 3.5 Media Manager after it has loaded all of the items to browse in the library and gallery views but I cannot for the life of me find an event that I can bind to...
Does anybody know if there is something like a 'wpMediaEditorLoaded' event triggered when all the images have been loaded or something similar that I could use?
I found I could use this
wp.media.view.Attachments.prototype.on('ready',function(){
//this runs once for each tab in the media editor so unbind previous versions
jQuery(document).unbind('ajaxComplete', mediaLibraryLoaded);
jQuery(document).bind('ajaxComplete', mediaLibraryLoaded);
});
var mediaLibraryLoaded = function(e, xhr, options) {
jQuery(document).unbind('ajaxComplete', mediaLibraryLoaded);
//do stuff here
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.