我在WordPress名称中有脚本问题:Project Slides。
这个脚本有效,有一天就停止了。我检查了控制台出了什么问题并得到了这个:
VM138 plupload-image.js?ver=4.2.2:67 Uncaught Error: Syntax error, unrecognized expression: #[object HTMLDivElement].max_file_uploads
at Function.fa.error (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:12733)
at fa.tokenize (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:18786)
at fa.select (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:21594)
at Function.fa (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:7320)
at Function.a.find (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):9:3686)
at n.fn.init.find (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:24109)
at n.fn.init.a.fn.find (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):9:8931)
at a.fn.init.n.fn.init (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:24676)
at new a.fn.init (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):9:3137)
at n (http://www.wieczoreklab.pl/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.1 (old):2:406)
然后我查看这个bug显示的源代码,就是这样:
rwmb_image_uploaders[prefix].bind( 'FilesAdded', function( up, files )
{
var max_file_uploads = $( '#' + this.settings.container + ' .max_file_uploads' ).val(),
uploaded = $( '#' + this.settings.container + ' .rwmb-uploaded' ).children().length,
msg = 'You may only upload ' + max_file_uploads + ' file';
if ( max_file_uploads > 1 )
msg += 's';
任何人都可以告诉我这段代码有什么问题吗?
答案 0 :(得分:0)
您只需要替换所有
this.settings.container
(对我而言,它在第67,68,87,112和113行)
this.settings.container.id
解决问题。
这对我来说是一个名为“Inovado”的旧WordPress主题