Interesting Idea: Theme that Creates Pages, Automatically
I am interested in the opinion of people on this list as to whether they see any problem in a theme adding Pages to the database when it is activated…
This, it turns out, is perfectly possible, as explained by Alan J. Castonguay:
A theme is just a visually-oriented plugin, and can do anything that a ‘normal’ plugin can do, including wp_insert_post()’ing Pages. The theme’s functions.php file is loaded in wp-settings.php, just after the plugins, but before the init hook, for every page load.
How awesome. Can you imagine it now? Create a theme that automatically install a Contact Form for the users! Or pretty much any other pages that gets filled by plugins, only in this case the page is automatically there instead of requiring users to create that page and input whatever the magic keyword needed to invoke a plugin’s functionality. Woah.
(Of course, it’s probably best to ask user first whether they want to create that Page, but still.)