The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. Ayman
    Posted 3 years ago #


    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
    Posted 3 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic