Insert a new post or page via script (blog setup)
-
I’d like to create a script or plug-in that I can run on every new blog I create. The purpose of the script would be to prepopulate the blog with my main post and three pages (about us, contact us, and privacy).
I’m unsure what the wp API calls are that would be needed to insert new pages and posts into the database. Any help, much appreciated.
The content for the about us and contact us is short and could be stored in a variable for the insert. However, the content for the privacy policy is long and will be stored in an .html file which can be parsed and then copied into the database.
Thanks for your help!
Alternately, It might make more sense to just create a prototype site, then create a backup of that database and use this as the basis of the new site. But I would like a script or plug-in that would update the site from the backup (without using myphpadmin, for example)
- The topic ‘Insert a new post or page via script (blog setup)’ is closed to new replies.