From 316174c4e9d2491b1bb5fa3cb5e0021aa8578dc6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 23 Feb 2007 23:47:57 +0000 Subject: [PATCH] Proper atom enclosures. Props rob1n. fixes #1464 git-svn-id: https://develop.svn.wordpress.org/trunk@4930 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/feed-atom.php | 4 ++-- wp-includes/feed.php | 32 +++++++++++++++++++++----------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/wp-includes/feed-atom.php b/wp-includes/feed-atom.php index 17fce725d1..fe3ff13590 100644 --- a/wp-includes/feed-atom.php +++ b/wp-includes/feed-atom.php @@ -38,8 +38,8 @@ $more = 1; ]]> - + - + \ No newline at end of file diff --git a/wp-includes/feed.php b/wp-includes/feed.php index abee911e48..79f7886ade 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -173,19 +173,29 @@ function rss_enclosure() { 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 ( (array) $val as $enc ) { - $enclosure = split( "\n", $enc ); - print "\n"; - } - } + foreach (get_post_custom() as $k => $v) { + if ($key == 'enclosure') { + foreach ((array)$val as $enc) { + $enclosure = split("\n", $enc); + echo apply_filters('rss_enclosure', '' . "\n"; } } } } -?> +function atom_enclosure() { + global $id, $post; + if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) + return; + + foreach (get_post_custom() as $k => $v) { + if ($key == 'enclosure') { + foreach ((array)$val as $enc) { + $enclosure = split("\n", $enc); + echo apply_filters('atom_enclosure', '' . "\n"; + } + } + } +} + +?> \ No newline at end of file