简体   繁体   English

wordpress在生成的页面上不包括javascript

[英]wordpress not including javascript on generated page

I am having issues with javascript functionality not working in the admin area. 我在管理区域无法使用javascript功能时遇到问题。 When writing a new post things like the ScreenOptions button or the Publish box do not work. 在撰写新帖子时,诸如ScreenOptions按钮或“发布”框之类的功能将不起作用。

I have a local wordpress development install and a deployment install on the live site. 我在实时站点上有本地wordpress开发安装和部署安装。 Locally is working. 在本地工作。 I have compared the generated HTML for the post-new.php of both sites and they are different. 我已经比较了两个站点的post-new.php生成的HTML,它们是不同的。

The one that does not work is failing to include some javascript into the file. 一个不起作用的是无法在文件中包含一些javascript。 So, in the working file I have some javascript inside script tags that is missing in the file not working. 因此,在工作文件中,我在脚本标签中有一些javascript脚本,这些文件在缺少的文件中不起作用。

Why would that be?! 为什么会这样?

Failed to mention the plugins I was using. 无法提及我正在使用的插件。

Wordpress 2.8.2., Magic Fields Version 1.3.1 to generate custom write panels. Wordpress 2.8.2。,Magic Fields版本1.3.1生成自定义书写面板。 Then I have WPML 1.7.1 and Akismet 2.2.7 in the live. 然后我有WPML 1.7.1和Akismet 2.2.7。 No other plugins. 没有其他插件。

I was going to comment that but it made me think that perhaps the error was with Magic Fields. 我要发表评论,但这使我认为错误可能出在Magic Fields。

Sure enough, found something. 果然发现了一些东西。 If you go to file RCCWP_Processor, line 368: 如果转到文件RCCWP_Processor,则行368:

add_action('admin_print_scripts', array( 'RCCWP_WritePostPage',
'CustomFieldsJavascript' ));

If you change admin_print_scripts to admin_head it starts working for me. 如果将admin_print_scripts更改为admin_head它将开始为我工作。

add_action('admin_head', array( 'RCCWP_WritePostPage',
'CustomFieldsJavascript' ));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM