Technosailor.com Readers! Donate today to assist the Lambi Fund Haiti Peasant Relief in their efforts.

26 March 2007 4 Comments

Automatic Activation of Plugins

A long time “want” for WordPress, especially since dealing with a large number of blogs at b5media, has been to have a WordPress MU feature that provides a directory whereby all plugins are automatically activated. I have asked for it on back channels for several months now, but it wasn’t until recently that I realized how simple (and how backwards) the same functionality could be. I have to give credit to Barry and Matt at Automattic for pointing this out to me. Oh, Ryan did too.

The answer is the long-time hidden resident of WordPress, the my-hacks.php file. You create a plugin directory where all plugins will be activated from (we call it b5-plugins), and then simply update the my-hacks file as such:

1
2
3
<php
require_once('wp-content/b5-plugins/my-plugin.php');
?>

We could probably go one better and read all the files in that directory into an array an execute, but my security fritz goes off when I get to that level of blind automation.

Pick up your copy of the WordPress Bible, a wildly popular resource for beginners and experts alike.

Popularity: 1% [?]

4 Responses to “Automatic Activation of Plugins”

  1. Tony 28 March 2007 at 12:51 pm #

    Great tip. You are a WordPress guru. You mention WordPress MU in the post, is that what you are running over at b5? From your prior entries about updating and such, it sounded like you were running single WordPress installations.

  2. Aaron Brazell 28 March 2007 at 12:53 pm #

    We run single installs of WordPress that are tied together through a suite of system level tools we have developed . :-)

  3. Tony 2 April 2007 at 2:02 pm #

    So what made b5 go with single WP installs over WPMU? And thanks for commenting back – I find WP very fascinating, especially coversing with experts like yourself.

  4. Aaron Brazell 2 April 2007 at 2:13 pm #

    Several reasons actually – not the least was that when b5 started, no one was on staff that understood MU (not sure anyone still is) as well as a year and a half ago, MU was nowhere near ready for prime time. It would be a pain to switch now, especially since it does not offer us much that we have not already engineered ourselves.