I can't believe I'm still trying to get this plugin to work as described, but I'm determined to to leave an audit trail for other users so that they can avoid spending the time I already have.
For the avoidance of doubt, it's easy enough to get the plugin working in its basic configuration - creating a tags blog of the core posts and metadata without further configuration. I had it working in less than 30 minutes, so if that's all you're looking to do, then read no further. The problems start when configuring for custom taxonomies or custom fields (i.e. additional post metadata) and perhaps (especially) when working within a BuddyPress installation.
I have tried every variation of the 'add_filter' suggestions provided on this post and elsewhere and in my configuration (WP3.1.2 & BP1.2.8), there's not the slightest change in outcome from the SWT plugin. From what I can deduce, the 'wp_get_object_terms' does not function within a BuddyPress installation. That seems a strange conclusion, since it's so core to the workings of the wordpress platform.
I'm sure it would be useful to know why, at the very least to flag the issue to other BP developers, but there seems little interest in doing so judging my own experiences - but hey, I'd be delighted if somebody could prove me wrong.
After failing to integrate custom taxonomies with the SWT plugin, I moved over to post formats and specifically the custom fields that I'm working with (video-embed, link-url, quote-copy, quote-author, quote-url, audio, image).
There is a routine within the **sitewide tags pages plugin** which takes a list of custom fields (entered in the admin settings) and then uses these as keys to read a post and output the keys and values in an array.
Here's the routine within sitewide-tags.php: http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/
*** line 369 in Version: 0.4.1.1 of sitewide-tags.php ***
$meta_keys = apply_filters( 'sitewide_tags_meta_keys', get_sitewide_tags_option( 'tags_blog_postmeta', array() ) );
$global_meta['DEBUG TEST1'] = $meta_keys;
$global_meta['DEBUG TEST2'] = $post_id;
if( is_array( $meta_keys ) && !empty( $meta_keys ) ) {
foreach( $meta_keys as $key )
$global_meta['DEBUG TEST3'] = 'custom loop';
$global_meta[$key] = get_post_meta( $post->ID, $key, true );
}
unset( $meta_keys );
I have added a small amount of markup to reveal what is happening at each step.
For my test case, post_id #1121, there is one custom field which sits in the wp_9_postmeta table has one meta_key 'image' with a corresponding meta_value 'http://newsite.com/files/2011/05/alfaP.jpg'
However the routine returns no value within the function.
Here's what each of the debug tests shows;
DEBUG TEST1:
a:7:{i:0;s:11:"video-embed";i:1;s:9:"image-url";i:2;s:8:"link-url";i:3;s:10:"quote-copy";i:4;s:12:"quote-author";i:5;s:9:"quote-url";i:6;s:9:"audio-url";}
DEBUG TEST2: 1121
DEBUG TEST3: Custom Loop
So the first test (#1) shows that all the custom fields are being returned from the 'get_sitewide_tags_option' on line 1. The second test (#2) confirms it's looking at the correct post_id and the third test (#3) that it reaches the foreach loop and therefore passes the conditional clause.
I then added a further check to understand what the variable '$key' contains whilst in the foreach loop. In fact, the custom fields are being held within the array but the loop returns NULL when it reaches the 'get_post_meta' command.
Is this another example where a standard WP command if failing within BP? Seems unlikely but I'll escalate to the BP developer team just in case.
So, in conclusion if you've been told that the SWT plugin works flawlessly and are about to invest time in making it a part of your own network, then I'd advise you to run a few tests first just to be sure it can meet your needs. There is very little information available and few discussions to learn from, so hopefully this post will provide something to start with.
Here are some further references I would also recommend for anyone wishing to understand what can be customised:
http://dev.commons.gc.cuny.edu/2009/07/20/making-sitewide-tags-work/#comment-987
http://teleogistic.net/2010/08/enabling-popularity-contest-for-wordpress-networkwide-use/