WPMU new blog settings plugin

This plugin was updated to work with version 2.6 – see here.

In a new forum thread this week a WordPress MU user asked an old question: how to set the default timezone offset for new blogs? The solution proposed was to edit the wp-admin/includes/schema.php file (line 275). This of course should work but it involves in changing wpmu core files, an option I think is not the best one.

The option I propose is to set the default timezone offset option, and other options as well, using a plugin. This is really simple by using the wpmu_new_blog hook. The entire thing is less than 10 lines of code:

<?php
function new_blogs_setting( $blog_id )  {
//set your options here:
update_option('gmt_offset', 2);
// stop editing here
return;
}
add_action('wpmu_new_blog', 'new_blogs_setting');
?>

The plugin can be downloaded from here (wpmu_new_blog.zip) and needs to be droped in the mu-plugins directory. One can add any other default option settings. In the case were a change of an option for existing blogs is required, the script to set global options for all WPMU blogs may be used.

Did you find this post interesting? Please subscribe to my feed.

Comments 14