Creating a one click demo importer

edit: I’ve re-written this because it is unclear, apologies it was written rushed on a Friday afternoon.

WordPress has import/export functionality for posts within wordpress, I am a theme developer trying to export demo content with my theme, I would like users to be able to click a button within my plugin and then that will load in all the demo content.

The problem is WordPress’s native functionality only handles posts and media images, it does not handle things like site options (I would like to set the front page post) and widgets + their locations, my question is how can I write something that would import my widget settings and some site options

1 Answer
1

I believe that if you are not going to do a massive sql insert (which I think is likely just as efficient) that you need to go ahead and utilize the plugin api and at the time of the button being pressed, create them. I think it’s pretty clear your choice is either to create the widgets on the fly, or to import through an sql insert.

http://codex.wordpress.org/Plugin_API should point you in the right direction if you’d prefer to avoid the SQL insert.

Leave a Comment