Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a large MultiSite network, and each page is designed a bit differently. I'm looking to write some custom code to automate the setup of a new blog as much as I can.

Things I'm looking to do for every new blog:

  • Activate a theme
  • Create some new pages (contact, about us, etc.)
  • Add and configure some widgets
  • Etc.

I'm completely willing (even eager) to write custom code to make this automation happen. However, I'd like to leverage as much existing code as possible. What recommendations do you have in order to make this happen?

I know that I can use wp_insert_post() to insert posts and pages, but how should I go about activating a theme, enabling widgets, etc.?

share|improve this question
add comment

1 Answer

You'll want to hook into wpmu_new_blog. You can see the args you can pass it here (no codex right now...). That last $meta arg can take a lot of different settings.

You also might look into the WPMU New Blog Defaults. It doesn't seem to do everything you want, but it might at least contain some good examples for how to use that hook.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.