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

  1. ray wrote:

    very helpful.

    Posted 04 Apr 2008 at 12:49 pm
  2. Akashic wrote:

    Simple, easy and useful. Thanks! Will help in future updates.

    Posted 20 May 2008 at 4:06 am
  3. Margje wrote:

    I used this plugin to change the default language for a new created blog but it doesn’t seems to work wpmu 1.5.1

    I’ll put the next line in the plugin:

    //set your options here:
    add_option(‘WPLANG’, ‘nl_NL’);
    // stop editing here

    But the language is still english instead of nl_NL (dutch)
    What to do to change the default language for new created blogs in wpmu v1.5.1 ?

    Thanks in advance

    Posted 02 Jun 2008 at 3:22 pm
  4. Elad wrote:

    Try:
    update_blog_option( $blog_id, ‘wplang’, ‘nl_NL’ );

    I’m not sure why this is needed but I think it works. Please let me know.

    Posted 02 Jun 2008 at 5:13 pm
  5. Simon wrote:

    @Elad – your suggestion re: default language works correctly, once you’ve made the usual quote substitutions which are necessary with code posted in a WP blog. Thanks!

    Posted 24 Jun 2008 at 9:01 am
  6. Scot wrote:

    Wondering if this can be used to change the default role for a new blog owner from ‘admin’ to ‘author’? Also, i downloaded, placed n mu-plugins but could not find any reference to it on my site anywhere. Did I miss something?

    Thx

    Posted 01 Jul 2008 at 4:20 am
  7. Elad wrote:

    Scot, I guess it could but you will have search for the right option to change.

    This plugin doesn’t have any UI at all.

    Posted 01 Jul 2008 at 1:38 pm
  8. camner wrote:

    Hmmm…couldn’t get this to work in WPMU 2.6. I dropped the (edited) file into mu-plugins, added a blog, and nothing happened. Has something changed with the hook in 2.6?

    Posted 31 Jul 2008 at 2:05 am
  9. Elad wrote:

    camner – I will check and get back on this.

    Posted 31 Jul 2008 at 6:53 am
  10. Jess wrote:

    Hi Elad !
    First of all, thanks for your plugin, a very usefull one !
    Indead, as camner said if before, it doesn’t work on WPMU 2.6.
    Activating the plugin results an error :
    “Parse error: syntax error, unexpected T_RETURN in /homepages/xxxxxx/htdocs/mu/wp-content/plugins/wpmu_new_blog.php on line 19”

    I’ll try to figure out what’s going one, but if you can help, that would be great 😉

    Posted 21 Aug 2008 at 12:41 pm
  11. Jess wrote:

    Yep, the only bug on your plugin is… Me !
    I forgot to close an “‘” on a delcaration…
    Plugin Activeted Succefully ! 😉

    Posted 21 Aug 2008 at 12:49 pm
  12. Boonika wrote:

    Page with the new version of this plugin links to this page. That link is broken:
    http://www.ringofblogs.com/2007/12/21/wpmu-new-blog-settings-pluginwpmu-new-blog-settings-plugin/

    Cheers

    Posted 22 Aug 2008 at 2:37 pm
  13. Elad wrote:

    Thanks Boonika – fixed.

    Posted 22 Aug 2008 at 2:41 pm
  14. Suzanne wrote:

    Realy nice I checked all the wordpress plugins!

    Posted 22 Jan 2012 at 12:31 pm

Trackbacks & Pingbacks 4

  1. From WPMU new blog settings plugin - updated | Ring Of Blogs on 22 Aug 2008 at 2:41 pm

    […] have updated the WPMU new blog settings plugin to work with the new version of WordPress-Mu, 2.6 (for previous versions see here). The hook used […]

  2. From WP Plugin Archive » WPMU New Blog Settings Plugin on 03 Sep 2008 at 12:28 pm

    […] WPMU New Blog Settings Plugin von Elad Salomons kann ein Default Timezone Offset für alle Blogs eingestellt werden. […]

  3. From Timezone String :: お試しWP on 07 Jun 2010 at 8:59 am

    […] http://www.ringofblogs.com/2007/12/21/wpmu-new-blog-settings-plugin/ […]

  4. From WPMU New Blog Default Role Review – Best Wordpress Plugins on 26 May 2011 at 4:02 pm

    […] WPMU New Blog Default Role is a WordPress plugin which allows users to change their roles set when installing a new blog. Since creators of new blogs are automatically marked as the administrator, this plugin allows users to change their default roles after setting up a blog. […]

Post a Comment

Your email is never published nor shared. Required fields are marked *