A little how-to hack podPress files to get an custom RSS feed on the basis of media file name extensions:
(Line numbers are valid if you use podPress 8.8.6.3)
podpress.php line 237:
add_feed('enhancedpodcast', 'podPress_do_feed_enhanced_podcast');
'enhancedpodcast' is the slug (name) of the feed. e.g. http://www.example.com/?feed=enhancedpodcast
If you change it use only alpha-numeric ASCII characters (and no white spaces. Underscore and dashes are allowed.)
podpress.php start at line 693
old:
function podPress_do_feed_enhanced_podcast($withcomments) {
// this function creates a ATOM feed which contains only posts which have m4a or m4v files attached with podPress
GLOBAL $wp_query, $podpress_allowed_ext;
podPress_addFeedHooks();
// get only posts with podPress attachments
define('PODPRESS_PODCASTSONLY', true);
// make sure that only the podPress attachment which is a torrent file will be an enclosure in the ATOM item
$podpress_allowed_ext = Array('m4a', 'm4v');
// get only posts with m4a/m4v files
podpress_only_posts_with_certain_files($wp_query, $podpress_allowed_ext);
add_filter('wp_title_rss', 'podpress_extend_m4x_feed_title');
if (!function_exists('do_feed_atom') OR TRUE == version_compare('2.3', $wp_version,'>')) {
load_template(ABSPATH.PLUGINDIR.'/podpress/wp-atom1.php');
} else {
do_feed_atom($withcomments);
}
}
a RSS feed with post with .mp4 files:
new:
function podPress_do_feed_enhanced_podcast($withcomments) {
// this function creates a RSS feed which contains only posts which have m4a or m4v files attached with podPress
GLOBAL $wp_query, $podpress_allowed_ext;
podPress_addFeedHooks();
// get only posts with podPress attachments
define('PODPRESS_PODCASTSONLY', true);
// make sure that only the podPress attachment which is a torrent file will be an enclosure in the RSS item
$podpress_allowed_ext = Array('mp4');
// get only posts with mp4 files
podpress_only_posts_with_certain_files($wp_query, $podpress_allowed_ext);
add_filter('wp_title_rss', 'podpress_extend_mp4_feed_title');
do_feed_rss2($withcomments);
}
add a function to modify the subtitle of this feed:
function podpress_extend_mp4_feed_title() {
return sprintf(__('%1$s - mp4 Feed', 'podpress'), $title);
}
Furthermore modify the podpress_feed_functions.php file like this:
old:
if ( is_array($podpress_allowed_ext) ) {
if (FALSE == in_array($post->podPressMedia[$key]['ext'], $podpress_allowed_ext)) {
continue;
}
}
new:
if ( is_array($podpress_allowed_ext) ) {
if (FALSE == in_array($post->podPressMedia[$key]['ext'], $podpress_allowed_ext)) {
continue;
} else {
$preferredFormat = true;
}
}
The new feed will have the description and other information from the feed/iTunes settings page of podPress.