WordPress.org

Ready to get started?Download WordPress

Forums

Passing xml file and skip the first screen on WordPress Importer (2 posts)

  1. Ayman
    Member
    Posted 11 months ago #

    Hi,

    I'm creating a plugin that is downloading xml file from a remote server to the "local server", but the next step is to pass that downloaded file to WordPress Importer plugin and make the importer process it with out asking to upload a file to import so basicly passing the file to the uploader/importer and skipping the first screen.

    Any suggestions or Ideas?

  2. bcworkz
    Member
    Posted 11 months ago #

    Your script would need to send a POST request that exactly mimics the request sent by the first screen when you click the "Upload file and import" button. This includes sending the correct nonce that is checked for validity as well as all the other data. Check the source for wp_import_upload_form() in wp-admin/includes/template.php as well as the greet() and dispatch() methods of the WP_Import class in the plugin source to see what is really happening in a normal import process.

Reply

You must log in to post.

About this Topic