公共函数enqueue_admin_scripts(){$设置=wp_enque_code_editor(阵列(“type”=>“text/html”,“codemirror”=>数组(“indentUnit”=>2,“tabSize”=>2,),));wp_enqueue_script('自定义html小部件');wp_add_inline_script('custom-html-widgets',sprintf('wp.customHtmlWidgets.idBases.push(%s);',wp_json_encode($this->id_base));if(空($settings)){$settings=数组(“禁用”=>true,);}wp_add_inline_script('custom-html-widgets',sprintf('wp.customHtmlWidgets.init(%s);',wp_json_encode($settings),“之后”);$l10n=数组('errorNotice'=>数组(/*转换器:%d:错误计数*/'单数'=>_n('有%d个错误,必须先修复,然后才能保存。','有%d错误,必须修复后才能保存。’,1),/*转换器:%d:错误计数*/'复数'=>_n('有%d个错误,必须先修复才能保存。','有%d错误,必须修复才能保存',2),//@todo这是缺乏的,因为有些语言有专用的双重形式。有关JS中复数的正确处理,请参阅#20491。),);wp_add_inline_script('custom-html-widgets',sprintf('jQuery.extend(wp.customHtmlWidgets.l10n,%s);',wp_json_encode($110n),“之后”);}
查看所有引用 在Trac上查看 在GitHub上查看