我有一个基于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中提交无效的表单
发布评论