在Wordpress中提交无效的表单 [英] Invalid form submission in wordpress

查看:193
本文介绍了在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)作为第二个参数,否则由于某种原因,上传将被拒绝. 请参见 http://codex.wordpress.org/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 http://codex.wordpress.org/Function_Reference/wp_handle_upload#Parameters

这篇关于在Wordpress中提交无效的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆