Ever wanted to have plugins that only execute for your main site, so that you aren't running excessive amounts of code not being used elsewhere?
Here's a quick "hack" to do mu-plugins style. If a plugin works as an mu-plugin, it will have the same results with this.
1) Open up wp-settings.php, and look for the following around line 211
$plugins = glob( ABSPATH . 'wp-content/mu-plugins/*.php' );
if( is_array( $plugins ) ) {
foreach ( $plugins as $plugin ) {
if( is_file( $plugin ) )
include_once( $plugin );
}
}
Add after:
if ( $blog_id == 1 ) {
$plugins2 = glob( ABSPATH . 'wp-content/my-plugins/*.php' );
if( is_array( $plugins2 ) ) {
foreach ( $plugins2 as $plugin2 ) {
if( is_file( $plugin2 ) )
include_once( $plugin2 );
}
}
}
Now you can drop plugins into that dir, and they'll only execute for your primary site.
Pretty handy for testing, or just running the extras on the primary site only.
It could also probably be tweaked to run plugins for another blog_id, vice using the global plugin manager. Mainly because the more code you can cut down being read into memory, the better as your site gets bigger. Every little bit helps, right?