Oh, I see. That’s more complicated. My first suggestion would be to stick with one format. Do you really need all those options? I’m more of a video person, but doesn’t everyone just use MP3s?
If you’re committed to doing it I have an idea that will probably work but I haven’t tested it.
Use my plugin to create an enclosure for every format in the post.
Create a copy of wp-rss2.php for each format (give them names like wp-rss2-mp3.php, etc) then change the line <? php rss_enclosure(); ?>
to <? php kg-rss_enclosure_filetype(); ?>
Insert this function after the first line of the file:
function kg-rss_enclosure_filetype() {
global $id, $post;
if (!empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password)) return;
$custom_fields = get_post_custom();
if( is_array( $custom_fields ) ) {
while( list( $key, $val ) = each( $custom_fields ) ) {
if( $key == 'enclosure' ) {
if (is_array($val)) {
foreach($val as $enc) {
$enclosure = split( "n", $enc );
if ( trim ( $enclosure[ 2 ] ) == "audio/mp3" ) {
print "<enclosure url='".trim( htmlspecialchars($enclosure[ 0 ]) )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>n";
}
}
}
}
}
}
}
Change “audio/mp3” to whatever the mime type is for the file you want to enclose. I _think_ that will create a feed that only encloses the type you want. Then you just link to each feed from your site.