The MU forums have moved to WordPress.org

Enable Plugin and Widgets Automatically in WordPress MU (5 posts)

  1. zanfardinom
    Member
    Posted 15 years ago #

    Hi Everyone,

    How do you enable specific plugins and widgets (we created) automatically. We would like for users to create their own blogs with our plugins/widgets enabled automatically. Any help/suggestions would be greatly appreciated. Thanks in advance.

    zan

  2. Klark0
    Member
    Posted 15 years ago #

    Put them in mu-plugins. Anything plugin in there is activated across all blogs. Plugins in sub directories don't work though. But you can usually put them like this:

    wp-content/mu-plugins/pluginsubdir
    wp-content/mu-plugins/plugin.php

    Or put it in wp-content/plugins and use Plugin Commander to active it across all blogs and new blogs.

  3. tdjcbe
    Member
    Posted 15 years ago #

    Some plugins require some modifications to make them work this way. wp-shortstats is the first one that comes to mind. Please search the forums for specifics. Testing each plugin is a plus before releasing them onto your masses.

  4. pm.nordkvist
    Member
    Posted 15 years ago #

    Thanx for this. I was really lookng for a solution to auto-activate plugins. Great.

  5. nitetalker
    Member
    Posted 15 years ago #

    Plugin Commander will do the auto-activation, but if you want an automatically activated plugin to have certain settings different from the defaults, you will either need to modify the plugin or build a separate plugin having this framework:

    function blog_defaults( $blog_id )  {  
    
    // the following examples set core WPMU options
    add_option('blogdescription', "Yet another My Site blog");
    add_option('permalink_structure',"/%post_id%/");
    add_option('posts_per_page','25');
    add_option('template', 'mytheme');
    add_option('stylesheet', 'mytheme');
    add_option('current_theme', 'MyTheme');
    
    // the following examples set plugin options
    add_option("wpcms_post_control_revisions","n");
    add_option("wpcms_post_control_autosave","n");
    
    return;
    }
    
    add_action('populate_options', 'blog_defaults');

    There are existing plugins that set core WPMU options but none to my knowledge that set plugin options.

About this Topic

  • Started 15 years ago by zanfardinom
  • Latest reply from nitetalker