Make WordPress Core

Ticket #1464: 1464.diff

File 1464.diff, 1.4 KB (added by rob1n, 19 years ago)
  • wp-atom.php

     
    4444<?php if ( !get_option('rss_use_excerpt') ) : ?>
    4545                <content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
    4646<?php endif; ?>
    47 <?php rss_enclosure(); ?>
     47<?php atom_enclosure(); ?>
    4848<?php do_action('atom_entry'); ?>
    4949        </entry>
    5050        <?php endwhile ; ?>
  • wp-includes/feed.php

     
    195195        }
    196196}
    197197
    198 ?>
     198function atom_enclosure() {
     199        global $id, $post;
     200       
     201        if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) {
     202                return;
     203        }
     204       
     205        $custom_fields = get_post_custom();
     206        if ( is_array($custom_fields) ) {
     207                while ( list($key, $val) = each($custom_fields) ) {
     208                        if ( $key == 'enclosure' ) {
     209                                if ( is_array($val) ) {
     210                                        foreach ( (array) $val as $enc ) {
     211                                                $enclosure = split( "\n", $enc );
     212                                                print "<link href='".trim( htmlspecialchars($enclosure[ 0 ]) )."' rel='enclosure' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n";
     213                                        }
     214                                }
     215                        }
     216                }
     217        }
     218
     219?>
     220 No newline at end of file