This line ofのwp-plupload.jsはアップローダーキューが完全にリセットされますことを示しています。だから、これを行うことができます。
wp.Uploader.queue.on('reset', function() {
alert('Upload Complete!');
});
私はそれをテストしたのだが、WP 3.5サイト上で動作します。
だから、ここ「アップロードニューメディア」ページと「メディアを挿入」の新pluploadアップローダーダイアログに関する定期的なアップローダーの両方のサポートを含む、完全なバージョンがあります。
というJavaScriptファイルを作成します: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!');
});
}
最後に、 WP Adminでこの機能を得るためにあなたのテーマののfunctions.phpにこれを追加します。
//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');
これは合法的な解決策ではないかもしれませんが、それは少なくとも、回避策です。
http://wordpress.stackexchange.com/ –