简体   繁体   English

Wordpress:JavaScript无法在服务器上的wp-admin中工作

[英]Wordpress: javascript not working in wp-admin on server

I have made a custom post type of name "vendors" in wp-admin. 我在wp-admin中创建了一个名为“ vendors”的自定义帖子类型。 Now what i want is that user could not enter duplicate post title. 现在我想要的是该用户无法输入重复的帖子标题。 So what am doing is when user enter post title i check it by query in save custom post function in functions.php thatis the entered post title not exist it should save post but if it already exist I apply Delete query and delete that post and display javascript alert "this entry already exists" and by javascript window.location redirect user to wp-admin/post_new.php to reneter. 所以在做什么,当用户输入帖子标题时,我通过在functions.php中保存自定义帖子功能中的查询来查询它,即输入的帖子标题不存在,它应该保存帖子,但是如果已经存在,则应用删除查询并删除该帖子并显示javascript警报“此条目已存在”,并通过javascript window.location将用户重定向到wp-admin / post_new.php以重新获得收入。 It was working very fine on localhost . localhost上运行得很好。 But when I uploaded on server. 但是当我上传到服务器上时。 Delete query is working fine but it is auto redirecting on wp-admin/edit.php. 删除查询工作正常,但可以在wp-admin / edit.php上自动重定向。 Neither window.location nor alert is working. window.location和警报均不起作用。 Please help me. 请帮我。

Upload a fresh wp-admin folder to the server. 将新的wp-admin文件夹上载到服务器。 That is the correct solution. 那是正确的解决方案。 It worked for me. 它为我工作。

The reason for this issue is sometimes there may be some problems occured during the previous upload of wordpress folder. 出现此问题的原因是,有时在上载wordpress文件夹期间可能会发生一些问题。

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

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