This line ofWP-plupload.js은 업 로더 큐가 완료에 다시 것을 보여줍니다. 그래서 당신은이 작업을 수행 할 수 있습니다
wp.Uploader.queue.on('reset', function() {
alert('Upload Complete!');
});
나는 그것을 테스트했습니다 그것은 WP 3.5 사이트에서 작동합니다.
그래서, 여기에 "업로드 뉴미디어"페이지와 "미디어 삽입"대화을에 새로운 plupload 업 로더에 대한 일반 업 로더 모두에 대한 지원을 포함한 전체 버전입니다.
라는 이름의 자바 스크립트 파일 만들기 :
wp-admin-extender.js
및 템플릿 디렉토리 내에서
/custom/js/
폴더 또는 어떤으로 저장합니다.
// Hack for "Upload New Media" Page (old uploader)
// Overriding the uploadSuccess function:
if (typeof uploadSuccess !== 'undefined') {
// First backup the function into a new variable.
var uploadSuccess_original = uploadSuccess;
// The original uploadSuccess function with has two arguments: fileObj, serverData
// So we globally declare and override the function with two arguments (argument names shouldn't matter)
uploadSuccess = function(fileObj, serverData)
{
// Fire the original procedure with the same arguments
uploadSuccess_original(fileObj, serverData);
// Execute whatever you want here:
alert('Upload Complete!');
}
}
// Hack for "Insert Media" Dialog (new plupload uploader)
// Hooking on the uploader queue (on reset):
if (typeof wp.Uploader !== 'undefined' && typeof wp.Uploader.queue !== 'undefined') {
wp.Uploader.queue.on('reset', function() {
alert('Upload Complete!');
});
}
그리고 마지막으로;
//You can also use other techniques to add/register the script for WP Admin.
function extend_admin_js() {
wp_enqueue_script('wp-admin-extender.js', get_template_directory_uri().'/custom/js/wp-admin-extender.js', array('media-upload', 'swfupload', 'plupload'), false, true);
}
add_action('admin_enqueue_scripts', 'extend_admin_js');
이것은 합법적 인 솔루션이 아닐 수도 있지만 적어도 해결의 : WP 관리자에서이 기능을 얻을 수 있도록 테마의 functions.php에 이것을 추가합니다.
http://wordpress.stackexchange.com/ –