| 176 | | $custom_fields = get_post_custom(); |
|---|
| 177 | | if ( is_array($custom_fields) ) { |
|---|
| 178 | | while ( list($key, $val) = each($custom_fields) ) { |
|---|
| 179 | | if ( $key == 'enclosure' ) { |
|---|
| 180 | | if ( is_array($val) ) { |
|---|
| 181 | | foreach ( (array) $val as $enc ) { |
|---|
| 182 | | $enclosure = split( "\n", $enc ); |
|---|
| 183 | | print "<enclosure url='".trim( htmlspecialchars($enclosure[ 0 ]) )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n"; |
|---|
| 184 | | } |
|---|
| 185 | | } |
|---|
| | 176 | foreach (get_post_custom() as $k => $v) { |
|---|
| | 177 | if ($key == 'enclosure') { |
|---|
| | 178 | foreach ((array)$val as $enc) { |
|---|
| | 179 | $enclosure = split("\n", $enc); |
|---|
| | 180 | echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n"; |
|---|
| | 186 | function atom_enclosure() { |
|---|
| | 187 | global $id, $post; |
|---|
| | 188 | if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) |
|---|
| | 189 | return; |
|---|
| | 190 | |
|---|
| | 191 | foreach (get_post_custom() as $k => $v) { |
|---|
| | 192 | if ($key == 'enclosure') { |
|---|
| | 193 | foreach ((array)$val as $enc) { |
|---|
| | 194 | $enclosure = split("\n", $enc); |
|---|
| | 195 | echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n"; |
|---|
| | 196 | } |
|---|
| | 197 | } |
|---|
| | 198 | } |
|---|
| | 199 | } |
|---|
| | 200 | |
|---|