Default blogroll and category

We had a new-blog-default written for us that already fires correctly to force-switch the theme for new blogs immediately after creation via the wpmu_new_blog.

I'm trying to add to our existing network-wide mu-plugin to achieve following results:

  1. Dump the default WP blogroll links
  2. Add new links
  3. Change the default category from Uncategorized to another name

We can't depend on our bloggers to figure out how to do this on their own since many of them are really novice users. We need this to happen automatically on the blog creation.

Here's what I'm starting with so you can see where I'm at:

function tfu_new_blog_defaults($blog_id, $user_id) {
        $template = 'teachforus/tfu-master';
        $stylesheet = 'teachforus/tfu-blogger';
       switch_to_blog($blog_id);
	        switch_theme( $template, $stylesheet); // set the default theme
		set_theme_mod( 'header_image', '' ); // Set a blank header image
//this is where I know I can insert new code
        restore_current_blog();
}
add_action('wpmu_new_blog', 'tfu_new_blog_defaults', 10, 2);

Here's the list of links getting auto-inserted by WP right now:

  • Documentation
  • Plugins
  • Suggest Ideas
  • Support Forum
  • Themes
  • WordPress Blog
  • WordPress Planet