Please Note: This is a WordPress MU plugin, do not install it on a standalone version of WordPress. WPMU and this plugin require some PHP knowledge. It’s not intended for end users. You have been warned! 🙂
The sitecategories table in WPMU is somewhat broken. It’s a left over from the upgrade to the new term / taxonomy structure introduced in WordPress 2.2. This plugin removes the filter that keeps the sitecategories table up to date. Instead, it creates two new tables ‘site_terms’ and ‘site_term_taxonomy’.
Then it populates these tables every time a new term or term_taxonomy is created, and keeps the IDs in sync on each individual blog. The end result is that you have a global term / term_taxonomy system.
This is fairly useless in itself. However, it provides the foundation for the SH Global Posts plugin which provides global categories, global tags, global search, etc.
This plugin relies on a core code change. I’ve requested that this be included in WP core, but as at May 2008 that hasn’t been done. So, you will need to edit the file manually.
You can download the patch here. Or, you can edit the files manually. Look for this line in wp-includes/taxonomy.php:
$term_id = apply_filters('term_id_filter', $term_id, $tt_id);
Then immediately following it, add this line:
$tt_id = apply_filters('term_taxonomy_id_filter', $tt_id, $term_id);
So the end result will be this:
$term_id = apply_filters('term_id_filter', $term_id, $tt_id); $tt_id = apply_filters('term_taxonomy_id_filter', $tt_id, $term_id);
As at revision 1260 (27 May 2008) this code appears twice in the wp-includes/taxonomy.php file, at lines 1228 and 1484. The quickest way to find these lines is search the code for “term_id_filter”.
When you install the plugin, it will check if it has already been installed (using a site option) and then globalise all your existing terms / term_taxonomies. This could take some time and will happen on the first page request (anywhere on the site) immediately after install. So I’d suggest installing when the site is quiet and hitting a page immediately.
This plugin must be installed for all blogs on your site, so it must be in the ‘wp-content/mu-plugins’ directory. If you install it in the ‘wp-content/plugins’ directory the world may very well end. 🙂
I’m happy to answer developer questions here and there, but I can’t provide end user support for this plugin. If you can’t read the code and understand what it does, I’d suggest avoid using the plugin. If you ask me very nicely and promise to send me chocolate cake, I might be able to help. But it’s strictly at your own risk. Please post any questions in the comments on this page.
0.1.1 – Updated plugin description
0.1 – First public release