在Wordpress中提交无效的表单

编程入门 行业动态 更新时间:2024-10-28 19:33:16
本文介绍了在Wordpress中提交无效的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个基于wordpress的分类站点,我正在尝试创建一个xml feed应用程序,该应用程序从其他站点获取xml并创建广告.我可以通过提要在wordpress中创建帖子.但是我无法从远程服务器复制图像,没有权限问题,我正在使用worpress函数wp_handle_upload_error,但是我遇到了错误

I have a wordpress based classifieds site, i am trying to create and xml feed application that fetches xml from other sites and create ads. I am able to create post in wordpress from the feeds. But i cant copy the images from the remote server,there are no permission issues, i am using the worpress function wp_handle_upload_error, But i get error

此代码

public function xml_image_upload($upload) { if ($this->xml_file_is_image($upload['tmp_name'])) { $file = wp_handle_upload($upload, $overrides); } return $file; }

我得到的错误是"无效的表单提交"

我试图解决这个问题已经很长时间了.我不知道怎么了..

I am trying to solve this for a long time. I cant figure out whats wrong..

推荐答案

您需要传递array('test_form' => FALSE)作为第二个参数,否则由于某种原因,上传将被拒绝. 请参见 codex.wordpress/Function_Reference/wp_handle_upload#Parameters

You need to pass array('test_form' => FALSE) as the second parameter or the upload will be rejected for some reason. See codex.wordpress/Function_Reference/wp_handle_upload#Parameters

更多推荐

在Wordpress中提交无效的表单

本文发布于:2023-10-07 17:56:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470095.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   Wordpress

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!