Invalid form feed in wordpress

I have a WordPress-based ad site, I am trying to create an xml feed application that retrieves xml from other sites and creates ads. I can create a message in wordpress from feeds. But I can not copy images from a remote server, there are no resolution problems, I use the worpress function wp_handle_upload_error, but I get an error

This code

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

The error I get is " Invalid submit form "

I have been trying to solve this for a long time. I can’t understand what happened.

+7
source share
1 answer

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

+26
source

All Articles